I'm trying to make procedural sound effects using the "new sound () rate () Hz" block but I couldn't figure out how to use it.
I tried looking it up, but all I found was a tutorial on importing sound and a bunch of scratch tutorials. I also tried using the "() of sound ()" block as an example, but it didn't show me anything.
Since I couldn't find even one, I'm asking for an example of how to use it.
Also, one final request, if a dev finds this, please add help... for the block.
The input for the new sound block is a list of samples. To get an example of what it looks like, import a sound, and get the samples of the sound with the () of sound () block.
In order to understand what the numbers are, you can use the plot sound block in the audio comp library.
The rate in the new sound block is just the sample rate of the sound. I can't explain it right now, but I know if you google it, you'll find an answer.
The sound reported by NEW SOUND isn't a variable of any kind; it's a value, of type Sound. You can do anything with it that you can do with values. I mean, for example, when you do (ROUND (3.14)) it reports a number, namely 3. That isn't a variable, but, like any other value, you can set a variable to it; you can put it in a list; you can SAY it; you can query its type with the IS _ A _ block; and so on. Same for sounds! You can set a variable to a sound; you can put it in a list; you can SAY it; etc.
I used to tell my SICP students, "Any time you find yourself wanting to ask 'Can you use X as input to Y?' the answer is always 'Yes.' " Data are data.