Maybe I misunderstood the function of the "play sound until done block," maybe my script is faulty, or maybe Scratch is spazzing out. Whatever the reason, this isn't working:
What I want to happen:
The list "minuet" contains the numbers for 16 sounds. The script goes to each sound, plays it, then moves on to the next, plays it, etc.
But this is what is happening:
The script skips a lot of the sounds. It usually only plays the last on the list. Sometimes it also plays the one at index 9. I've tried in normal, single-stepping, and turbo, with all the same result.
Anyone know what's wrong?
Offline
The script works for me... are you sure that the items in the list and the sound file names are matching up?
Offline
Try uploading the project and we can see more info.
Offline
OK, I didn't want to post it (I have a policy about posting unfinished projects
), but I can't think of anything else to try (I already re-installed Scratch, tried using the same sounds from a different website, etc), so I shared my poor broken project. I put broken all over it so nobody would yell at me about it not working. Anyway, maybe it's just my computer, but it works the same way online as offline. Press Generate. If it's working, you should hear a fairly long song (32 measures). If it's not, you should hear a very short song (2-4 measures). The failing scripts are in the stage and the Scratch cat (with the "PlayMinuet" or "PlayTrio" hat).
Here it is
I really hope the problem is just something stupid I'm doing.
Last edited by scmb1_prime (2011-01-03 13:26:58)
Offline
That was me in case you didn't know.
It turns out, that, at least online, it isn't just my computer. I tried it on another computer and it worked the same way.
I also realized how ugly my button is online. I'll fix that before sharing it for real.
Last edited by scmb1 (2011-01-03 15:59:27)
Offline
Just noticed something: the numbers that get added to "minuet" and "trio" have a seemingly random number of spaces at the end of them. But none of the scripts should do that...
Edit: Ah, I found the problem - most of the items in the lists "m" and "t" have spaces at the end of them (sometimes in front of them, even). Since numbers can't have spaces, it'll return 0 instead (and song #0 doesn't exist).
Now, the only problem would be taking the spaces out of all those items
Last edited by hmnwilson (2011-01-03 19:57:51)
Offline
hmnwilson wrote:
Just noticed something: the numbers that get added to "minuet" and "trio" have a seemingly random number of spaces at the end of them. But none of the scripts should do that...
Edit: Ah, I found the problem - most of the items in the lists "m" and "t" have spaces at the end of them (sometimes in front of them, even). Since numbers can't have spaces, it'll return 0 instead (and song #0 doesn't exist).
Now, the only problem would be taking the spaces out of all those items![]()
Thanks so much! It was an easy fix. All I had to do was multiply each value going into "minuet" and "trio" by 1 to turn them into integers, which got rid of the spaces. Thanks- you rock! I'll mention you in my Project Notes.
Offline
You just had to get rid of the list block...
Last edited by MarioLuigi2009 (2011-01-04 19:26:20)
Offline
It should be working fine. I mean, at least its nothing "stupid" you´re doing. Just... dont get frustrated and all and try to keep a clear mind in order to solve a problem.
Hope I helped,
Sincerely,
Oswaldo.
Offline
This looks like it's solved now - I'll close it ^^
Offline