Discuss Scratch

Tuckermarley
New Scratcher
1 post

How to make an Audio Visualizer?

Not sure where to put this, so I figured this section would be the best place to post.

I want to try to make an audio visualizer, but I have no idea how to get Scratch to detect music I put in and actually visualize it, help please?
DaEpikDude
Scratcher
1000+ posts

How to make an Audio Visualizer?

I'm not sure it's possible: there aren't any blocks that let you detect sound frequency etc. (all it has is volume).
Realistically all you can do is either pre-make it for a certain set of sounds or just put in random pretty colours.
Scratch-Minion
Scratcher
1000+ posts

How to make an Audio Visualizer?

You can do it as follows.
You need speakers and a microphone for this to work! (a webcam on your device is fine).

Write a project that plays the song / music using the block
play sound [ v]

Once the song starts have a loop in your project that samples the loudness of the music using the loudness block and then draws a simple representation of the loudness on the stage.
eg. if your song is 95 seconds long
reset timer
repeat until <(timer) > [95]>
clear
go to x: (0) y: (0)
pen down
move (loudness) steps
end

Check that this is working ie. the visualizer reacts to the sound


Now create a list “Song Loudness”
Inside the loop above put
add (loudness) to [Song Loudness v]

After running the project the list will have all the song loudnesses stored in it.
Remove the line
add (loudness) to [Song Loudness v]
as you don't want to damage the list.

Now you can rewrite the project replacing
reset timer
repeat until <(timer) > [95]>
end
with
set [n v] to [1]
repeat until <(n) > (length of [Song Loudness v] :: list)>
change [n v] by (1)
end
and rather than using “loudness” for your visualizer, use:
(item (n) of [Song Loudness v] :: list)


The project can now be run using your recorded loudness values in the list.

I did exactly this in my project Sound Visualizer a la Minion: https://scratch.mit.edu/projects/179187908/ which uses a list of loudnesses if a microphone is not detected.
11111Ashley
Scratcher
1 post

How to make an Audio Visualizer?

i don't get what your doing i don't understand how to do it scratch-minion it would be good if you made a video on how to do it
gtoal
Scratcher
1000+ posts

How to make an Audio Visualizer?

here's an example of a volume-based display: https://scratch.mit.edu/projects/157976976/

you could build on that to do your own visualisation
PawPrinter
Scratcher
47 posts

How to make an Audio Visualizer?

Scratch doesn't have any waveform-analyzing functionality, so making a true audio visualizer is not possible. However, you can look at your song's waveform in another program and based on that information animate something in Scratch.
EclipsedGames
Scratcher
66 posts

How to make an Audio Visualizer?

As others above have pointed out, there's no way for Scratch to analyze wavelengths. You can, however, use the
(loudness)
block to simulate wavelengths via microphone. If you want to see how this is done, check out the Audio Visualizer studio (I'm not going to link it for you because it's featured on the front page)
Uniquename1
Scratcher
100+ posts

How to make an Audio Visualizer?

For challenge sake, you can make music and you may be able to base visuals off of other variables. Note, tempo, instrument, volume what you can control on scratch. Many people make midi type things or something more randomized so as not to have to code out whole songs note by note. Then you'll have more info to base your visualizer on.

1. I'd thought about making something like a non scratch thing I saw that scans a table each second set up with various shapes at certain physical heights. Not sure of specifics but higher on y is higher pitch from left to right is the timing and certain shapes may mean things or sustain a note and use a camera to project the actual table into scratch in real time. Thats different but just throwing it out there.
Zak-A-Tack
Scratcher
6 posts

How to make an Audio Visualizer?

Okay, I get it!
Jimmyjangy
Scratcher
2 posts

How to make an Audio Visualizer?

Okay, how do you make a sprites mouth move when you say some thing?
DerpyHead0
Scratcher
1000+ posts

How to make an Audio Visualizer?

Jimmyjangy wrote:

Okay, how do you make a sprites mouth move when you say some thing?
don't necropost or hijack
Zak-A-Tack
Scratcher
6 posts

How to make an Audio Visualizer?

_ScrollWriter_
Scratcher
11 posts

How to make an Audio Visualizer?

I'm trying to do this on one of my projects, but i want it to react to audio I'm playing inside the project! How in the world to I do that?
ChlB441
Scratcher
100+ posts

How to make an Audio Visualizer?

Jimmyjangy wrote:

Okay, how do you make a sprites mouth move when you say some thing?
Look at these!
https://scratch.mit.edu/projects/207648736/
https://scratch.mit.edu/projects/190402666/
AnEvergreenTree
Scratcher
52 posts

How to make an Audio Visualizer?

It would be cool if Scratch 3.0 had a sound-length tracker of some sort.
92ebuddy20
Scratcher
70 posts

How to make an Audio Visualizer?

Yeah I wish 3.0 did ):
Robotboy665
Scratcher
1 post

How to make an Audio Visualizer?

i want it to viualize the song much like this one https://scratch.mit.edu/projects/181307508
Werewolf_Animator
Scratcher
2 posts

How to make an Audio Visualizer?

Hello! I have found the MOST SIMPLE way to make a visualizer! It takes these:
say [
when green flag clicked] for (2) secs
\
when green flag clicked
forever
change size by (loudness)
set size to (100) %
Zak-A-Tack
Scratcher
6 posts

How to make an Audio Visualizer?

Well, that makes sense
92ebuddy20
Scratcher
70 posts

How to make an Audio Visualizer?

Werewolf_Animator wrote:

Hello! I have found the MOST SIMPLE way to make a visualizer! It takes these:
say [
when green flag clicked] for (2) secs
\
when green flag clicked
forever
change size by (loudness)
set size to (100) %[/quote]
TYSM THIS HELPED

Powered by DjangoBB