Discuss Scratch

blackthelawliet
New Scratcher
1 post

Making an object change colour when a loud sound is played

So, I've been working on a project and one of the things I wanted to make is that when a loud sound is played, the colour of an object changes.
I've tried adding a highly distorted and bass boosted sound and then added this block

when loudness>10change coloreffectby25

And it didn't seem to work. I tried again going to the sounds tab and making the sound even louder and then tried again, and it didn't work.
What am I doing wrong?
asivi
Scratcher
1000+ posts

Making an object change colour when a loud sound is played

blackthelawliet wrote:

So, I've been working on a project and one of the things I wanted to make is that when a loud sound is played, the colour of an object changes.
I've tried adding a highly distorted and bass boosted sound and then added this block

when loudness>10change coloreffectby25

And it didn't seem to work. I tried again going to the sounds tab and making the sound even louder and then tried again, and it didn't work.
What am I doing wrong?
Hard to help for anybody without a project and knowledge for your flashplayer, browser, or devices (microphone) at your PC settings.
Mrman99
Scratcher
100+ posts

Making an object change colour when a loud sound is played

As far as i know Scratch ignores sounds made by the computer.
EDIT: Maybe it's just certain computers or settings.

Last edited by Mrman99 (Jan. 4, 2017 12:14:02)

asivi
Scratcher
1000+ posts

Making an object change colour when a loud sound is played

Mrman99 wrote:

As far as i know Scratch ignores sounds made by the computer.
EDIT: Maybe it's just certain computers.
No,
loudness
What it needs to work is a microphone or a PC sound' card able to pass playing sounds through internally like a microphone would do it.
titanscratch
Scratcher
100+ posts

Making an object change colour when a loud sound is played

Try this:
whenloudness>10changecoloureffectby25Orwhenvolume>10changecoloureffectby25
I hope I helped.
stickfiregames
Scratcher
1000+ posts

Making an object change colour when a loud sound is played

loudness is the volume of the sound being detected by the microphone - if you don't have a microphone it will always be 0.
volume is the volume used to play notes and sounds, which is 100 by default. It's like the volume setting on your computer or speakers.

There is currently no way to get the volume of the sound output in realtime. It is possible to precalculate it with external programs as is done here, although I don't know how you would do it.

I think there have been a few projects in the past that need to respond to the sound being played and just tell you to put your microphone next to your speakers, but that's obviously not an ideal solution.

Last edited by stickfiregames (Jan. 10, 2017 22:53:59)

Powered by DjangoBB