How to modify an audio file's frequency

I have to use Processing to make a program for school. It's very simple (a basic piano), but I'm running into some problems here. The people I'm working on this program with and I have already made it by creating a different audio file for each piano key, but that's not exactly a very elegant way to make this, since all these audio files combined weigh 13.5 Mo.

I'm thinking of fixing this by using only one audio file corresponding to any piano key, then somehow modify its frequency so that it makes pretty much the same sound as any piano key I want it to. I think this is doable with Minim, which we use. I've seen these kinds of things :

Frequency currentFreq currentFreq = Frequency.ofPitch( "A4" );

But I assume the object "Frequency" is not the same as an audio file. I couldn't make it work, anyway.

So I'd be really happy if someone could help, thanks a lot in advance. If there are any alternative, easier solutions (or if my idea isn't even doable in the first place), I'll definitely take them. In case this wasn't obvious enough, my Processing skills aren't exactly excellent. :P

(apologies if I asked this question in the wrong category)

Tagged:

Answers

Sign In or Register to comment.