[squeakland] Playing musical notes

Steve Thomas sthomas1 at gosargon.com
Thu Jul 21 11:44:23 EDT 2011


So you want to *TEST* if the Holder's Cursor goes back to one (or
1.something) and the *stop script* that is playing the notes.

Hmmmm. Well if I could watch the *Holder's cursor *(I like to look at it on
the playfield and I really like to see *decimal places*, its a strange
fetish I have).

Then if I could step by step take the *Holder's cursor* and *increment by *some
number let's say 0.3, I might be able to be able to determine its behavior.

That would be one, Etoys challenge.

But then I think about the problem again and another challenge.  Let's say I
have a variable (noteToPlay) and I start it at 1 and increment it by 0.5.
 Then I set the Holder's cursor to the value of the variable. Well that
could NEVER work because if I had 3 items in the collection, I couldn't set
the cursor to 4.  But then I remember the wise words of Justin Beiber (Never
say Never). So perhaps I will be brave and try ;)

Stephen


On Thu, Jul 21, 2011 at 7:55 AM, Christine Murakami <
cmurakami at columbusschoolforgirls.org> wrote:

> Hi Bert and all.****
>
> ** **
>
> I tried the suggestion below with the holder and the notes. It works
> perfectly, and I learned a lot in the process! Always a great side benefit.
> ****
>
> ** **
>
> I have a follow-up question that will be helpful as we work on these
> projects.
>
> ****
>
> Is there a way to get the holder to stop playing once the song is over?
> Right now, it continues back at the beginning, just like an animation would,
> playing continuously until you click the stop all scripts button. ****
>
> ** **
>
> As always, many thanks for the help! It took me a while to figure out, but
> this will help with ALL these musical projects!****
>
> ** **
>
> Christine****
>
> ** **
>
> *From:* Bert Freudenberg [mailto:bert42 at gmail.com] *On Behalf Of *Bert
> Freudenberg
> *Sent:* Monday, July 11, 2011 10:38 AM
> *To:* squeakland
> *Cc:* Christine Murakami
> *Subject:* Re: [squeakland] Playing musical notes****
>
> ** **
>
> Hi Christine,****
>
> ** **
>
> you can do "test counter > 5 and counter < 10" using two nested tests. The
> first would test for "counter > 5" and in its "yes" case there would be a
> test for "counter < 10". Of course that would be tedious for a whole song.
> ****
>
> ** **
>
> Here is a way to use the timer as suggested by Steve:****
>
> ** **
>
> ****
>
> ** **
>
> Each note is just a rectangle with an embedded text label. It has a
> variable for its frequency. Its width represents its duration. Many of them
> are put in a holder, and each can have their own frequency. The holder has a
> single variable, "until". This holds the timer value for the end of the
> currently playing note. When that time has passed, the next "until" is
> calculated from the width of the next note, and it is played.****
>
> ** **
>
> It's very simple to make more notes, you just duplicate them, and if
> necessary change freq and width. You could make a parts bin with all the
> preconfigured notes.****
>
> ** **
>
> This is similar to (though a lot simpler than) what I showed at Squeakfest.
> Ideas from that talk could be integrated as well - e.g., instead of playing
> the note right in the holder's script, each note could have a script that
> gets activated by the holder, and then could do more interesting things
> (like playing a rondo by repeating themes in ABACA form etc).****
>
> ** **
>
> - Bert -****
>
> ** **
>
> On 11.07.2011, at 14:34, Steve Thomas wrote:****
>
>
>
> ****
>
> 1) You can use the timer in the playfield category (can change decimal
> places I believe accurate to milliseconds)
>
> 2) Use a "piano roll" and place notes on the roll and have a "needle" move
> across the roll (or the roll move) and when the "needle" touches the note,
> it will play that note.
>
> You could have kids play a frequency based on it's y position and have them
> draw a score.  They could also have the note sustain based on its length.
> You can also change the tempo by moving the needle at different speeds.
>
> Stephen****
>
> On Mon, Jul 11, 2011 at 7:04 AM, Christine Murakami <
> cmurakami at columbusschoolforgirls.org> wrote:
>
> ****
>
> Hi everyone!
>
> I have been working with students on creating music lessons, and there is a
> gap in my knowledge of Etoys that is preventing them from going further in
> their projects.
>
> Many of them would like a song to play (using the play frequency tile). The
> only way I can think to do this is to either create a variable counter that
> counts a beat or to use the playfield counter. Either way, it seems like
> Etoys ought to have a command that does something like "while counter > 5
> and counter <10 play frequency 880" or even using a test in a similar way:
> "test counter > 5 and counter < 10".  I just can't figure out how to have a
> sound play for a specific amount of time - especially a few beats into the
> song. The first few we can fudge, but after that it gets too complicated. I
> need to help them find a better solution.
>
> I've looked at both Pling and the chord game for suggestions, which helped
> with other issues but not this one.
>
> Any suggestions would be most appreciated! I've been struggling with this
> since early May!
>
> Thanks!
>
> Christine
> _______________________________________________****
>
> ** **
>
> ** **
>
> _______________________________________________
> squeakland mailing list
> squeakland at squeakland.org
> http://lists.squeakland.org/mailman/listinfo/squeakland
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakland.org/pipermail/squeakland/attachments/20110721/9ac5516a/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 38624 bytes
Desc: not available
URL: <http://lists.squeakland.org/pipermail/squeakland/attachments/20110721/9ac5516a/attachment-0001.png>


More information about the squeakland mailing list