These are the guidelines for my class project that I need help on.
Encode a song into a list (or set of lists) as we will have done in class. This may be an original composition or a song you like, but it should be encoded using deltas rather than absolute notes.
Write the Scratch code to read your list(s) and play the song they encode. Do this in such a way that allows you to transpose the song into any key simply by changing the starting note.
Devise a way for the user to change the starting note without having to explicitly change it in the code.
I've decided to do mary had a little lamb but something with my code is not working right. I would greatly appreciate if someone with more experience could take a look and see what I did wrong. I've attached screenshots of my project below. Thanks
http://imageshack.us/photo/my-images/3/littlelamb1.png/
http://imageshack.us/photo/my-images/821/littlelamb2.png/
Offline
In the second picture, it shows the top script:
when I receive [play pattern v] repeat (# of notes) broadcast [lead note v] and wait change [lead note v] by (item (lead note delta list index) of [lead note delta list v]) change [lead note delta list index v] by (1) endInstead I think it should be:
when I receive [play pattern v] repeat (# of notes) broadcast [lead note v] and wait set [lead note v] to ((starting note) + (item (lead note delta list index) of [lead note delta list v])) change [lead note delta list index v] by (1) end
Last edited by AtomicBawm3 (2012-04-02 20:05:18)
Offline
I tried that and it didn't seem to make a difference. Do you have any other ideas on how I can improve this or any ideas about how I should go about doing the project?
Offline
Here's how I would go about it: encode a song like this in a list:
<note> <length> <note> <length> ...
the when reading, use the following script:
when gf clicked set [n v] to [-2] forever change [n v] by [2] play note ((item ((n) + (1)) of [notes v]) + (key-transpose)) for (item ((n) + (1)) of [notes v]) beats set [n v] to ((n) mod (length of [notes v])You can make "key-transpose" a slider on the stage monitor.
Last edited by Hardmath123 (2012-04-03 10:12:34)
Offline