Audio - Master Pitch
BlitzMax Forums/BlitzMax Programming/Audio - Master Pitch
| ||
I'm looking to be able to play ogg files, to be able to alter the master pitch of sound, and release my app with NO required components. That is all I need, but it seems OpenAL requires a dll, as does FMod. Any suggestions? ps. Master Pitch, not Rate. |
| ||
1) you can calculate the pitch from the "rate". 2) Just use blitz internal audio? |
| ||
The rate speeds up the music, rather than changing the pitch, which is not what I need. I need to change the master pitch, not the speed =( Unless you mean something else? otherwise I would use #2. Time |
| ||
If the rate speeds up the music then you know that 2 doubles the speed, which makes the pitch twice as high. So if you have a 1000hz sound, and you want a 2000hz sound, double the rate. also, what about: New_rate=(1.0/current_pitch)*new_pitch. |
| ||
Sorry, but it seems no matter what you do with hertz and rate, the speed will change, or it will sound the exact same. In my case the speed MUST remain the same, while the pitch is altered. I really don't think blitzmax basic audio can do this, not that easily anyways. Could I maybe alter the samples (byte ptr) somehow to achieve this? Example, that does not work: |
| ||
That needs resampling the audio wich is a high CPU demanding task. Not sure if OpenAL can do it, but the standard MAX audio engine (and most multiemdia audio engines) can't resample several audio channels at real time. |
| ||
It's actually for a single short sound effect, so speed shouldn't be much of a problem. I have very little understanding of how a sound is read, or how to alter the data. Can you provide some insight on how I can resample this, at load time even? |
| ||
Then what you are after is going to be rather difficult. You can't just change the pitch of a sound and have the sound play for the same amount. :-( perhaps someone else can provide you with some insite but theres more to do than I really have time for, sorry! |
| ||
Can't you just create the sound at the pitch you want it to be? |
| ||
I'll need it at about 30 different pitches lol. It's looking like I'll have to create seperate sounds at this rate though. |
| ||
perhaps you could provide an example usage for this sound? People might be able to offer alternative solutions. |
| ||
Maybe create several pre-pitched sounds as `key pitches` and then just change the rate of each sound - it wont get very much shorter/faster as you do so, if the distance between sounds isn't too big. Would be nice to be able to change pitch without changing speed though. |