I’m planning on writing a chord palette tool that will allow the user to play any piano chord. I’ve got all the 88 piano note samples and the palette set up for doing this.
Now all I need is for some way to mix the samples (which are individual notes) to make a chord and then play the chord (several notes simultaneously). I’d like to be able to use OGG/MP3 samples since that reduces the size of my PocketPC application – I’m using embedded Visual Basic.
If it’s possible I’d really appreciate any assistance.
I’ve been thinking of creating an XM file, using all the 88 notes as individual samples, and then having a chord play every 10 seconds and then just seeking a multiple of 10 seconds to play a specific chord. Like this
0:00:00 – C Major
0:00:10 – C# Major
0:00:20 – D Major
0:00:30 – D# Major
0:00:40 – E Major
0:00:50 – F Major
0:00:60 – F# Major
0:00:70 – G Major
0:00:80 – G# Major
0:00:90 – A Major
0:01:00 – A# Major
0:01:20 – B Major
0:01:30 – C Minor… … … … and so on and so on.
I’m sure either approaches are possible with FMOD/CE, but I’m not sure how to go about doing them. I think the second approach would be fairly easy, just setting the play position to multiples of 10 seconds for whatever chord is to be played, play it, and then stopping about 9 seconds after the chord has played.
So confused. If anyone out there has some idea how to play multiple sounds at any one time or to seek a position in an XM file and play for a specified number of seconds, I’d really appreciate any assistance.
- benjamind asked 12 years ago
So if I just call PlaySound for each of the notes in the chord it will play simultaneously?
I was thinking something like this (I know the code is probably not correct but it’s just an abstract idea):
And it would play the C Major chord?
Can I use PlaySound for OGG/Mp3 files?
I’m not familiar with FMOD. I’m only a baby when it comes to serious development, but I’m learning my way around.
Any help would be much appreciated
Thanks for that Brett, I was so confused in the beginning.
I thought the “PlaySound” call was the standard windows API call that I use to load WAV files in Win32. I didn’t realise that it was actually in the FMOD API.
Cool, that means I can use MP3/OGG to save storage space. I figure each piano note (sustained for 5 seconds) will be about 100Kb for a decent quality setting in OGG format, so all the notes would be 88 x 100Kb = approx 9mb. Which is really great.
Just another question – is it possible to use reverb/DSP with FMOD when using PlaySound calls?
The reason I wanted to play compressed sounds was because of storage space concerns. Pocket PCs usually have 32-64mb of memory (25-50mb actually usable). My Pocket PC also has a 256mb storage card in addition to 64mb which is really handy, but I’m planning on offering my program as freeware on KVRAudio, along with my “Chord Swatch” for Win32.
Now…I think I can start working on my Chord Swatch for PPC !
Please login first to submit.