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?Mike wrote:Just one small addition:
It is also possible to use an own string for each voice.Mike wrote:[...] more than one voice would be done by interleaving the note data in the string, [...]
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=...).
Musical Note Duration Conversions
Moderator: Moderators
- Gorf
- Vic 20 Dabbler
- Posts: 92
- Joined: Tue Feb 09, 2016 6:55 pm
- Website: http://home.macintosh.garden/~europa/
- Location: United States
- Occupation: Eccentric Musician
Re: Musical Note Duration Conversions
She/Her
SoundCloud: https://soundcloud.com/user-385492180
YouTube: https://www.youtube.com/channel/UC3uSQ5 ... AJkFHzReqw
SoundCloud: https://soundcloud.com/user-385492180
YouTube: https://www.youtube.com/channel/UC3uSQ5 ... AJkFHzReqw
- Mike
- Herr VC
- Posts: 4838
- Joined: Wed Dec 01, 2004 1:57 pm
- Location: Munich, Germany
- Occupation: electrical engineer
Re: Musical Note Duration Conversions
Yes.Gorf wrote: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?Mike wrote:Just one small addition:
It is also possible to use an own string for each voice.Mike wrote:[...] more than one voice would be done by interleaving the note data in the string, [...]
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=...).
- Gorf
- Vic 20 Dabbler
- Posts: 92
- Joined: Tue Feb 09, 2016 6:55 pm
- Website: http://home.macintosh.garden/~europa/
- Location: United States
- Occupation: Eccentric Musician
Re: Musical Note Duration Conversions
Ok, thank you.Mike wrote: Yes.
She/Her
SoundCloud: https://soundcloud.com/user-385492180
YouTube: https://www.youtube.com/channel/UC3uSQ5 ... AJkFHzReqw
SoundCloud: https://soundcloud.com/user-385492180
YouTube: https://www.youtube.com/channel/UC3uSQ5 ... AJkFHzReqw
- Kweepa
- Vic 20 Scientist
- Posts: 1315
- Joined: Fri Jan 04, 2008 5:11 pm
- Location: Austin, Texas
- Occupation: Game maker
Re: Musical Note Duration Conversions
To make Mike's player more timing explicit:
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.
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
To ensure the first note is the right length you can add a @ to the start of the string.
- Gorf
- Vic 20 Dabbler
- Posts: 92
- Joined: Tue Feb 09, 2016 6:55 pm
- Website: http://home.macintosh.garden/~europa/
- Location: United States
- Occupation: Eccentric Musician
Re: Musical Note Duration Conversions
Ok, thank you for that addendum (hopefully I spelled that correctly).Kweepa wrote:To make Mike's player more timing explicit:
Then each letter in the string is 3/60th of a second, and the music lasts exactly 3/60*len(a$) seconds.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
To ensure the first note is the right length you can add a @ to the start of the string.
She/Her
SoundCloud: https://soundcloud.com/user-385492180
YouTube: https://www.youtube.com/channel/UC3uSQ5 ... AJkFHzReqw
SoundCloud: https://soundcloud.com/user-385492180
YouTube: https://www.youtube.com/channel/UC3uSQ5 ... AJkFHzReqw