Hey guys, I'm working on a music project in SCRATCH, but I've seemed to have encountered some kind of problem.
The music projects is based on a composition I created for the piano, both the left hand and right hand playing simultaneously. At first I created a single sprite, with two scripts, one for the right hand melody line, the other for the left hand harmony line, both scripts done in this manner:
When 1 Key pressed
Play note for 0.5 beats
Play note for 0.5 beats
(and so on, until it's done)
It seems to work fine most of the time, but sometimes, the scripts didn't synchronize: one script would shoot off slightly earlier than the other, and the melody and harmony lines would be in discordance.
I moved one of the scripts to the other sprite, thinking that might be the issue, but still no such luck. I also changed the instruments of the melody line, but again, the synchronization problem would randomly occur.
Anybody got ideas on how to synchronize the two scripts together?
EDIT:
Here's the link to the project, if anyone is interested:
http://scratch.mit.edu/projects/cheddargirl/533212
Last edited by cheddargirl (2009-05-18 18:38:23)
Offline
It's becuse of all the lag. I found one way around it is to shift-click on Extras, click "set single stepping" and set it to turbo. You have to do that every time you open the project, though.
Offline
You can use the [Broadcast and wait] system I used in this project:
http://scratch.mit.edu/projects/MyRedNeptune/451954
The whole melody is split into parts (loops), which are broadcasted one after another in a single script.
Offline
hmnwilson wrote:
It's becuse of all the lag. I found one way around it is to shift-click on Extras, click "set single stepping" and set it to turbo. You have to do that every time you open the project, though.
Wow, that significantly improved the execution time within the first run. It's too bad that can't set turbo speed single stepping when running projects online
Offline
MyRedNeptune wrote:
You can use the [Broadcast and wait] system I used in this project:
http://scratch.mit.edu/projects/MyRedNeptune/451954
The whole melody is split into parts (loops), which are broadcasted one after another in a single script.
Hmm, broadcast messages, I've never thought about using those. Thanks for the tip and the link! I'll go check it out
Offline