Skip to Content

better sound script for Pico Board sensors

« How do I...?
4 replies [Last post]
Peter Ross
Member

Hi.

I've been using the Pico boards for some conductivity exercises using the resistors. We've been having fun doing the musical fruit projects and such. The basic script I am using is:

play note (resistance-A sensor value) for .02 beats" inside a forever block.

This works OK, but I was wondering if there was a way to have the note play longer while being able to adjust the resistor value at the same time - something like a Theremin, I guess.

Thanks.

Replies
Joyce Teibel
Member

Peter and Chalk,

Have either of you ever tried having kids play around with music and Scratch? Something like: where the kids would play a song as a group and each computer in the room played a different part - or one computer started the song, and then the next computer would pick up where the last one left off? 

Reading your exchange on creating sounds just gave me the idea.  I haven't done it with Scratch, but it seems like something kids would like. 

Actually, I tried something similar to this once with kids and logo, and the kids thought what they produced was great, but that was at a time when it seemed easier to impress students with the wonders of technology. But, even then I think it gave them that satisfaction we want kids to get with Scratch, that they can use technology to create and have fun.

Please let me know if you do anything in this area of playing around with music.

Eric Rosenbaum
Member

Hi Joyce,

 

At Scratch Day last year we had a music workshop which we called "Scratch Orchestra."  We experimented with something like what you described.  We had about 30 people, so we divided the room into groups, and each group made a different type of simple instrument with Scratch.  They were all triggered by the keyboard, and each group had a particular note or sound.  Then we experimented with having volunteers come up to the front and conduct the orchestra, by pointing to the groups, or by pointing to big symbols on a whiteboard.  It was fun, and a little cacophonous. 

 

A nice thing about it was that it made it possible to do something (kind of) musical with a large group of people in a small amount of time.  With fewer people and more time, I think it would be possible to do a more elaborate Scratch orchestra, with different people playing scratch instruments that made melodies, rhythms and harmonies at the same time.  

Chalk Marrow
Member

 Peter:

 

While you can't, as far as I know, change the note value while it is playing, one way to get the same effect is to have three sprites playing the note, where one sprite begins a short time after another one starts. So you essentially have three loops playing at the same time, and you don't hear a noticeable gap. It actually sounds kind of strange and Theremin-like:

 

Sprite 1:

When Flag Clicked

set instrument to 51

wait 0.33 secs

forever

       play note x for 1 beat

 

Sprite 2:

When Flag Clicked

set instrument to 51

wait 0.66 secs

forever

       play note x for 1 beat

 

Sprite 3:

When Flag Clicked

set instrument to 51 

forever

        play note x for 1 beat

 

 

Where x is of course your sensor input.  

Hope this helps.

Peter Ross
Member

Thanks. That script sounded better. It was fun having 5 computers running it at the same time.