How to us the new sound block

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.

I have a couple of questions.

  1. Is the sound a temporary variable or can it be used anywhere?
  2. Can you name the sound using the list?

If you want to keep the new sound, you do need to set it to a variable. If you want to add it to the sounds list in the sprite, just do

I actually don't know if you can set a name of a sound through code.

yes you can!

right, I never think about the primitive block, because that's more advanced, and not fully just snap.

yeah. I only know about that extension because it is used in the TEXT COSTUME block from the library.

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.

I made a block that simplifies the process of making a sound

untitled script pic


new sound block

How it works

Thanks to @starbox614 and @ego-lay_atman-bay for giving me the information I used to make the block.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.