Login
Back to forumSee the full topicGo to last reply

Posted By

George
on 2014-08-07
21:08:46
 Re: Exact TED Frequency a for music beginners :-)

Hi MMS,

I experimented very long to convert music from Midi. I am no musician. There are tools, which can analyse the midi files and export them into music-notes and give every tone a number from 1 to 12.. My problem was, to find out the right frequencies for the notes. The Artikel helped a lot, because all the notes are numbered from 1...N(n=48!?) (analogy to the keys on a piano). These numbers were the key. Now i could match the notes.

After knowing this, i wrote the tune in one hour. And i was amazed about the result (compared to my failures, it sounds like music now). I usually use the Editor "Notepad++" for coding and then copy and paste the code to Yape.

The "plops" must have their reason in the Basic commands. The problem i had, was that if you play the same note two times (lets say two half C), than it sounds like one note of double length. I resolved this by doing a loop between the notes, which makes the plops worse. I don't know how i make a pause with the sound command. Basic is not the best way to program music, but this was a first try from a beginner. If you use the second voice the plopping gets worse. I am sure, the Experts here, know many better ways of doing this.

Machine-Language is far better. You switch a tone on..after a period of time you switch it off. Thats how the MIDI format-works basically. Perhaps its better to use Pokes than the "Sound" command.

I link the original MIDI file for comparison. For Basic, I think ,it comes suprisingly close to the original (done from a beginner like me)
original Midi

Dont forget, that the Plus/4 "sound-chip" is more or less a cheap Buzzer.

*********************************************************************************************************
ADD (06.08.2014):
*********************************************************************************************************
I made a new famous music title in Basic: "To zeibekiko tis Eudokias" from Manos Loizos.

Actually i had a lot of fun setting note by note. It took me 2 days.

The pause i mentioned before is realized now by Sound 1, 1024, 1 (instead of the silly loop). This note you cannot hear with human ears. The finetuning (compared to my previous) in this song was to maintain the timing right, when playing the same note repatedly. I solved this by reducing the duration of the previous note by 1, everytime a pause is played.
Now enjoy the tune. I hope you like it as much i like it.

To zeibekiko ths eudokias

The source-Midi i used:
To zeibekiko ths eudokias (MIDI)

@MMS: Thanks again for starting this thread
@Experts: Sorry for boring you with this very basic stuff.

I will experiment to add a second track to the next song i have in mind.

*********************************************************************************************************
ADD (08.08.2014):
*********************************************************************************************************
For those who are interested. This is a two track song. The code is from one of the programmers' books.
In my opionion it sounds horrible.

100 VOL 8
110 DIM N1%(66), N2%(66), D1%(66),D2%(66)
120 I=0
130 READ N1%(I),D1%(I): IF N1%(I)<0 THEN 150
140 I=I+1: GOTO 130
150 T1=I: I=0
160 READ N2%(I),D2%(I): IF N2%(I)<0 THEN 180
170 I=I+1: GOTO 160
180 I1=-1: I2=-1
190 IF D1>0 then 220:ELSE SOUND 1,N1,0
200 I1=I1+1: IF I1210 IF N1>0 then SOUND 1,N1,300
220 IF D2>0 then 250: ELSE SOUND 2,N2,0
230 I2=I2+1: D2=D2%(I2): N2=N2%(I2)
240 IF N2>0 THEN SOUND 2,N2,300
250 D1=D1-1: D2=D2-1
260 FOR i=1TO80:NEXT I: Goto 190
270 VOL 0
280 DATA 0,1,685,1,770,1,810,1
290 DATA 798,1,685,1,798,1,834,1
300 DATA 810,2,854,2,775,2,854,2
310 DATA 770,1,685,1,770,1,810,1
320 DATA 798,1,685,1,798,1,834,1
330 DATA 810,2,770,2, 0,4
340 DATA 0,1,854,1,810,1,854,1
350 DATA 770,1,810,1,685,1,739,1
360 DATA 704,2,770,2,834,2,864,2
370 DATA 864,1,834,1,798,1,834,1
380 DATA 739,1,789,1,643,1,704,1
390 DATA 685,2,739,2,810,2,254,2
400 DATA 854,1,810,1,770,1,810,1
410 DATA 704,2,834,2,834,1,798,1
420 DATA 739,1,798,1,685,2,810,2
430 DATA 810,1,770,1,704,1,770,1
440 DATA 643,2,798,2,810,6
450 DATA -1,-1
460 DATA 7,2,516,4,485,2
470 DATA 516,1,345,1,516,1,596,1
480 DATA 571,1,345,1,571,1,643,1
490 DATA 596,2,516,2,485,2,345,2
500 DATA 516,1,345,1,516,1,596,1
510 DATA 571,1,345,1,571,1,643,1
520 DATA 596,2,516,2,596,2,516,2
530 DATA 643,1,516,1,383,1,516,1
540 DATA 262,1,383,1, 7,1,169,1
550 DATA 118,2,262,2,453,2,571,2
560 DATA 571,1,453,1,345,1,453,1
570 DATA 169,1,345,1,118,1,118,1
580 DATA 7,2,169,2,262,2,383,1
590 DATA 118,1,262,1,118,2,118,2
600 DATA 169,1,345,1, 7,1,169,1
610 DATA 7,2 7,2
620 DATA 118,1,453,1,383,1 453,1
630 DATA 596,6
640 DATA -1,-1




Back to top


Copyright © Plus/4 World Team, 2001-2024