Playing a note as a string variable
Posted: Sun Feb 10, 2019 9:23 pm
If I want to play one note say C2, with instrument 25 in the default instrument bank the following code does it.
notes set "25:c2"
notes play
do !until NOTES_TIME() > NOTES_LENGTH()
However if I want to set the note to a string variable I can't get it to work.
So the code below works and produces the note using the default instrument.
note$="c2"
notes set note$
notes play
do !until NOTES_TIME() > NOTES_LENGTH()
If I want to change to another instrument where do I put the quote marks?
Notes set "25:note$" etc almost works. It plays a note but it is a different high pitched one.
25:note$, "25":note$, produce an error.
I notice in the help documentation that midi should be used for real time note playing so I will start looking at that as well.
notes set "25:c2"
notes play
do !until NOTES_TIME() > NOTES_LENGTH()
However if I want to set the note to a string variable I can't get it to work.
So the code below works and produces the note using the default instrument.
note$="c2"
notes set note$
notes play
do !until NOTES_TIME() > NOTES_LENGTH()
If I want to change to another instrument where do I put the quote marks?
Notes set "25:note$" etc almost works. It plays a note but it is a different high pitched one.
25:note$, "25":note$, produce an error.
I notice in the help documentation that midi should be used for real time note playing so I will start looking at that as well.