Document stub.png This article or section may not have content matching Scratch Wiki editing standards. Please improve it according to Scratch Wiki:Guidelines and Scratch Wiki:Editing Conventions. (February 2019)
Reason: The writing could be improved

This tutorial will show two different ways to make audio visualizers.

Note Note: A microphone is required to do this tutorial.

First Method

  1. Create a new sprite.
  2. Go to the blocks area, and click the "'Add Extension" button.
  3. Select the Pen Extension
  4. Add this code to your sprite:
when green flag clicked
forever
play sound [... v] until done
when green flag clicked
forever
erase all
go to x: (0) y: (0)//you can change the x and y value to where you want the visualizer to start
pen down
move (loudness) steps

Second Method

For this method, start by adding the script that will play the sounds you want to visualize.

when green flag clicked
forever
play sound [... v] until done

Once done, create 3 variables. For this example, the variables will be named variable1, variable2, and variable3. Add these scripts with your variables:

Note Note: Make sure you have loaded in the Pen Extension.
when green flag clicked
forever
Set [variable v] to ((loudness) + (pick random ( ) to ( )))
set [variable2 v] to ((loudness) * (1))
set [variable3 v] to ((variable2) / (2))

when green flag clicked
forever
change pen color by (variable3)

when green flag clicked
set pen color to ( )
forever
pen down
change pen size by ( )
change pen size by (- )

when green flag clicked
forever
change [color v] effect by (Variable 3)

when green flag clicked
go to x: (-6) y: (16)
set size to (100)%
forever
turn right (variable2) degrees
when green flag clicked
forever
next costume
wait (0.5) seconds

Now go into the sprite's costume editor, and select the "circle" tool. You can pick a color of your choice. Set the "Outline" to 0. Then, right-click the costume and select "Duplicate" 5 times. Next, use the reshape tool to reshape the circle to look like a lumpy circle for costumes 2-6. Don't change the circle in the first costume.