Play a sound while touching?

@Ignatz - Ok, but it doesn’t seem to play anything for me…

Anyway, I’m much stupider than I thought. The problem was that I was thinking about it all wrong. I had no clue you could change the pitch and the volume of a sound simply by changing sound.pitch and sound.volume… for some dumb reason I thought that once a sound was already being played, there was no possible way to change anything about it, but I was completely wrong. Oh well, problem solved now! Thanks @Ignatz and @yojimbo2000 for the suggestions!

By the way, to any developers of Codea:
For me, doing sound.loop = true doesn’t actually make the sound loop, however all the other variables I described before change the sound just fine. It doesn’t really matter though since you can just set whether the sound loops when calling the sound function. Fantastic app by the way, I love that multitouch actually works.

“Thank you” to @Ignatz. I was scratching my head over a problem I was trying to solve. I have multiple buttons created using a classes and each button plays a different sound, a music file rather. I want to play the music while pressing the button and stop when released.

Ignatz’s solution at the top of this discussion worked great. Thanks again.

Now on to the next problem.

…Scotty