Stopping a list of musical notes
Posted: Wed Jul 10, 2019 4:05 pm
Hi Team and everyone,
I am getting frustrated with such a tiny thing!
I am sure you will be able to solve this for me.
I am playing a series of notes in a repeat loop.
But I want to allow the user to stop the music if so desired.
The scripts I have been trying are these...
repeat while x< y
put line x of tmusic into tAudio
if the environment is mobile then
play (specialFolderPath ("cache") & "/theContent/" & tAudio)
else
set the defaultFolder to specialFolderPath("desktop")
play audioClip ("sounds/" & tAudio)
end if
wait 1 seconds
add 1 to x
end repeat
or
repeat while x< y
put line x of tmusic into tAudio
if the environment is mobile then
put (specialFolderPath ("cache") & "/theContent/" & tAudio) into tPath
put "queued" into tChannelName
put "next" into tType
mobilePlaySoundOnChannel tPath, tChannelName, tType
else
set the defaultFolder to specialFolderPath("desktop")
play audioClip ("sounds/" & tAudio)
end if
wait 1 seconds
add 1 to x
end repeat
I can get "the mouseClick" to be recognised on the mac, but not on the iPhone.
How can I interrupt the repeat?
All the best,
Jessamy
I am getting frustrated with such a tiny thing!
I am sure you will be able to solve this for me.
I am playing a series of notes in a repeat loop.
But I want to allow the user to stop the music if so desired.
The scripts I have been trying are these...
repeat while x< y
put line x of tmusic into tAudio
if the environment is mobile then
play (specialFolderPath ("cache") & "/theContent/" & tAudio)
else
set the defaultFolder to specialFolderPath("desktop")
play audioClip ("sounds/" & tAudio)
end if
wait 1 seconds
add 1 to x
end repeat
or
repeat while x< y
put line x of tmusic into tAudio
if the environment is mobile then
put (specialFolderPath ("cache") & "/theContent/" & tAudio) into tPath
put "queued" into tChannelName
put "next" into tType
mobilePlaySoundOnChannel tPath, tChannelName, tType
else
set the defaultFolder to specialFolderPath("desktop")
play audioClip ("sounds/" & tAudio)
end if
wait 1 seconds
add 1 to x
end repeat
I can get "the mouseClick" to be recognised on the mac, but not on the iPhone.
How can I interrupt the repeat?
All the best,
Jessamy