SomeVerbThatPlaysSongs() |
Problem description:
In short, I want this verb to change the song's attributes WHILE the song is playing. The code is a bit messy because I've been playing around with it, attempting to get things to work. From experimenting, I noted another issue which struck my curiosity. The frequency (originally set to 1.2) seems to be shifted to 1.44 (or around there) after the sound update (this takes place one second after the first time the music is played), which itself seems to fail entirely. I don't understand how the frequency can so clearly sound altered, and yet the frequency output still reads 1.2 after the modifications to the sound are all said and done. To sample my problem further, please note the comments associated with the above lines of code.
So the /sound object's vars don't necessarily correlate with the client's playing sound. It's similar to outputting an icon file to a label, then modifying that icon (in effect creating a new, altered icon) and expecting the label display to update to reflect the changes.
To update an existing sound, you need to output a sound object with the SOUND_UPDATE status flag, the changes you want and the same channel and file as the sound you're updating had. Here's a post with an example: [link]
I'm not sure how much of the rather messy-looking code you've tried or not and how exactly. var/sound/S = sound( "SomeSong.mid", repeat, 0, 100, 100 ) doesn't look like it'd compile, or it would compile erroneously, unless you have a repeat var declared within the scope. Additionally, 100 shouldn't be a valid channel.