HC Music that should be on Runtime Revolution

Colin Holgate coiin at rcn.com
Tue Mar 17 10:53:50 EDT 2009


On Mar 17, 2009, at 9:45 AM, Klaus Major wrote:

>> MIDI, with QuickTime in a player object.
>
> Yep!
>
> Alas, if we just could use internal/imported files within a player  
> object...


Well, I wasn't fully sure this would work, but it seems to (the first  
two lines just clear out the previous midi file):

set the filename of player 1 to ""
stop player 1
answer file "pick midi file"
put it into f
open file f for binary read
read from file f until eof
close file f
put it into field 1

open file "mymidi.mid" for binary write
write field 1 to file "mymidi.mid"
close file "mymidi.mid"
set the filename of player 1 to "mymidi.mid"
play player 1

I could quit Rev and reopen it, and just do the last lines:

open file "somethingnew.mid" for binary write
write field 1 to file "somethingnew.mid"
close file "somethingnew.mid"
set the filename of player 1 to "somethingnew.mid"
play player 1

and the tune played.

So, although the tunes are played from an external file, it was  
internal data just before then.





More information about the use-livecode mailing list