jmoenig/Snap--Build-Your-Own-Blocks — pull request #95 by pconrad (2013-05-18 01:09:08+00:00)
Title: set Instrument block, instrument reporter, envelope (to avoid pops in oscillator based sounds)

This is a pull request to show what we've been working on with adding a setInstrument block, an instrument reporter, and using gainNodes to create a proper ADSR envelope (Attack, Decay, Sustain, Release).

We have more we want to do, but we wanted to send a pull request now to get feedback, and because we saw that the Karplus-Strong work is proceeding, and we figure that we may want to try to compare notes before we get too far out of step with one another on the direction for sound.

Our initial goal was to try to provide at least as much capability as "plain old Scratch"---we have music majors that are using Scratch/Snap to do compositions. They all love the first-class-lists and ability to use functions in Snap, but the sounds so far (sine wave with annoying pops, and no dynamic control) are far less than what they were used to in Scratch.

They've seen Scratch 2.0, and were not impressed with the lack of capabilities of the lists compared to Snap. But still, snap is lagging behind in terms of sound capability, and we definitely want to address that! This is a first step...

Looking forward to your feedback! A slightly earlier version of this (but functionally equivalent) is online at https://foo.cs.ucsb.edu/snap --- the main difference is that we didn't yet merge all of the latest changes from Jens' repo together with our changes.