Discuss Scratch

animals1234l
Scratcher
78 posts

Converting piano key to pitch effect

I have been making a piano simulator and I am adding sound samples to it via .wav files. I have imported them and got it to work, but I am trying to figure out how to change the pitch like a piano note. Does anyone have a way to convert the piano key number (ie. 44, 32, 55, etc.) to a pitch effect?

It would be like this:
when I receive [CustomNote v]
set pitch effect to (Converted)
play sound [CustomNote v]

;
DownsGameClub
Scratcher
1000+ posts

Converting piano key to pitch effect

Unfortunately. From what I know there's not a block where you can modify a sound effect temporarily, though that would be cool.

You should suggest this in Suggestions. I think that's something the Scratch Team can consider.

–DGC
Scratcher since Aug. 2015 +++ Fire Alarm Enthusiast +++ College student studying fire protection engineering
animals1234l
Scratcher
78 posts

Converting piano key to pitch effect

DownsGameClub wrote:

Unfortunately. From what I know there's not a block where you can modify a sound effect temporarily, though that would be cool.

You should suggest this in Suggestions. I think that's something the Scratch Team can consider.
I was looking for some code that allowed you to do this.

;
colinmacc
Scratcher
1000+ posts

Converting piano key to pitch effect

animals1234l wrote:

I have been making a piano simulator and I am adding sound samples to it via .wav files. I have imported them and got it to work, but I am trying to figure out how to change the pitch like a piano note. Does anyone have a way to convert the piano key number (ie. 44, 32, 55, etc.) to a pitch effect?

It would be like this:
when I receive [CustomNote v]
set pitch effect to (Converted)
play sound [CustomNote v]

Rather than using wav files, have you thought about using the Scratch note blocks?

Sample Projects

animals1234l
Scratcher
78 posts

Converting piano key to pitch effect

colinmacc wrote:

animals1234l wrote:

I have been making a piano simulator and I am adding sound samples to it via .wav files. I have imported them and got it to work, but I am trying to figure out how to change the pitch like a piano note. Does anyone have a way to convert the piano key number (ie. 44, 32, 55, etc.) to a pitch effect?

It would be like this:
when I receive [CustomNote v]
set pitch effect to (Converted)
play sound [CustomNote v]

Rather than using wav files, have you thought about using the Scratch note blocks?
I am actually using the scratch note blocks, but I decided I wanted to add more sounds than scratch provides.

;
cheddargirl
Scratch Team
1000+ posts

Converting piano key to pitch effect

animals1234l wrote:

colinmacc wrote:

animals1234l wrote:

I have been making a piano simulator and I am adding sound samples to it via .wav files. I have imported them and got it to work, but I am trying to figure out how to change the pitch like a piano note. Does anyone have a way to convert the piano key number (ie. 44, 32, 55, etc.) to a pitch effect?

It would be like this:
when I receive [CustomNote v]
set pitch effect to (Converted)
play sound [CustomNote v]

Rather than using wav files, have you thought about using the Scratch note blocks?
I am actually using the scratch note blocks, but I decided I wanted to add more sounds than scratch provides.
What you're looking for is to import your own soundfont, but unfortunately that's not possible with the way Scratch is designed.

You might be able to achieve something like this if you're using one of the 1.x versions (since 1.x uses local soundfonts on your computer), but it would only be local to the computer you are using.

Sadly, my forum signature was eaten by an evil kumquat.
Flowermanvista
Scratcher
1000+ posts

Converting piano key to pitch effect

None of you guys are interpreting this poor Scratcher's post correctly.

What they're asking is: they are uploading sound samples as WAV files. Is there a possible way for them to change the MIDI pitch number into a number for the pitch shift effect?

Add a SPOOKY SKELETON to your project!

The Scratch 3 Project Save Troubleshooter - find out why your project won't save

ST, Please Add A Warning When A Size Limit Is Exceeded

My Dumb Creations - THE BEST ANIMATION | The Windows 98 Experience (made on Windows 98) | nobody cares about Me… | the2000 Reveals His New Profile Picture | Not Dumb Creations - Ten Years
Ctrl+Shift+Down for more…
Do evil kumquats keep eating your signature? Assert your dominance and eat the evil kumquats. Did you know that kumquats are only about the size of an olive?

Powered by DjangoBB