We are about to switch to a new forum software. Until then we have removed the registration on this forum.
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)
Answers
@PassTheSoap -- Hmm. I know that there are old demos of creating piano notes with minim Oscillators -- a "sine wave piano."
More recent minim demo code shows you how to play notes using
playNote
with Instruments (including the default instrument:Here is an old discussion of using pitch-shifted samples, like your approach above -- not with the minim library, but with Beads:
...and this recent piano project: