Page 2 of 2

Re: Musical Note Duration Conversions

Posted: Sat Jan 07, 2017 11:13 am
by Gorf
Mike wrote:Just one small addition:
Mike wrote:[...] more than one voice would be done by interleaving the note data in the string, [...]
It is also possible to use an own string for each voice.

That avoids the interleaving, but you have to take a little more oversight that the voices keep in step. You'd then retrieve the register values for all the voices from the same position in two or more strings instead of from two or more consecutive positions in the same one string.

You'll still have to write the registers as fast as possible, like in: POKEV+10,A:POKEV+11,B:POKEV+12,C - with the values in A, B and C retrieved beforehand (say, with A=N(MID$(..)).:B=...:C=...).
Just one more question, what if I wanted all the voices to play teh same note, just in their respective octave, could I then just use one set of notes for the piece of music I am trying to play? :D

Re: Musical Note Duration Conversions

Posted: Sat Jan 07, 2017 11:43 am
by Mike
Gorf wrote:
Mike wrote:Just one small addition:
Mike wrote:[...] more than one voice would be done by interleaving the note data in the string, [...]
It is also possible to use an own string for each voice.

That avoids the interleaving, but you have to take a little more oversight that the voices keep in step. You'd then retrieve the register values for all the voices from the same position in two or more strings instead of from two or more consecutive positions in the same one string.

You'll still have to write the registers as fast as possible, like in: POKEV+10,A:POKEV+11,B:POKEV+12,C - with the values in A, B and C retrieved beforehand (say, with A=N(MID$(..)).:B=...:C=...).
Just one more question, what if I wanted all the voices to play teh same note, just in their respective octave, could I then just use one set of notes for the piece of music I am trying to play? :D
Yes.

Re: Musical Note Duration Conversions

Posted: Sat Jan 07, 2017 3:03 pm
by Gorf
Mike wrote: Yes.
Ok, thank you. :mrgreen:

Re: Musical Note Duration Conversions

Posted: Tue Jan 10, 2017 3:05 pm
by Kweepa
To make Mike's player more timing explicit:

Code: Select all

6 t=ti:fori=1tolen(a$):pokev+12,n(asc(mid$(a$,i,1))-64):t=t+3:fors=0to0:s=ti<t:nexts,i
Then each letter in the string is 3/60th of a second, and the music lasts exactly 3/60*len(a$) seconds.
To ensure the first note is the right length you can add a @ to the start of the string.

Re: Musical Note Duration Conversions

Posted: Sun Jan 15, 2017 9:48 am
by Gorf
Kweepa wrote:To make Mike's player more timing explicit:

Code: Select all

6 t=ti:fori=1tolen(a$):pokev+12,n(asc(mid$(a$,i,1))-64):t=t+3:fors=0to0:s=ti<t:nexts,i
Then each letter in the string is 3/60th of a second, and the music lasts exactly 3/60*len(a$) seconds.
To ensure the first note is the right length you can add a @ to the start of the string.
Ok, thank you for that addendum (hopefully I spelled that correctly). :mrgreen: