Music playtime

Post Reply
User avatar
Dutchman
Posts: 866
Joined: Mon May 06, 2013 9:21 am
My devices: iMac, iPad Air, iPhone
Location: Netherlands
Flag: Netherlands

Music playtime

Post by Dutchman »

Working on a mjusical project and an update of the PDF-manual, i made the following test program:

Code: Select all

' Playtime
/*
Remark by smbstarv 24 may 2024:
"NOTESLENGTH() gives the length of the composition m$ played with NOTES TEMPO last set before the NOTES SET m$ was issued."
*/
' else NOTESLENGTH should be scaled to playtime
Bpm=90 ' tempo in beats per minute
NOTES SET "11:qcc#dd#eff#gg#aa#b"
' TEMPO set after NOTES SET command
NOTES TEMPO Bpm
' PlayTime depends now on tempo
PlayTime=120/Bpm*NOTES_LENGTH() 
PRINT "NOTES_LENGTH=";NOTES_LENGTH()
PRINT "Tempo=";Bpm;"Bpm"
PRINT "PlayTime=";PlayTime
NOTES PLAY
Play: IF NOTES_TIME() < PlayTime THEN Play
PRINT "NOTES_TIME=";NOTES_TIME()
END

Post Reply