[Openal] How to Change/Vary the Speed of Music?

Adam T. Bowen adamb at agitate.org.uk
Thu May 22 03:44:18 PDT 2008


Hi,

       This isn't OpenAL specific, but there is a "Change Tempo" effect 
in Audacity (a free, cross-platform sound editor), which will change the 
speed of a sample without changing the pitch (noticeably).  The source 
code is available from their website:

   http://audacity.sourceforge.net/download/source

so you could have a look at how they do it.  Remember to read the 
licensing though:

   http://audacity.sourceforge.net/about/license

Cheers

Adam

Chris Robinson wrote:
> On Thursday 22 May 2008 12:20:26 am 藺心皓 wrote:
>> Hi.
>>
>> I try to change the speed of music to do some effect like the
>> conductor can change the speed of whole band.
>> By changing Pitch, it may close to my object -- the speed of music was
>> change, but pitch also changed.
>> Is  there any method to change the speed but remain orignal pitch?
> 
> Unfortunately, it's not that easy. The audio data is just a long series of 
> pulses, at various strengths. Going through the pulses faster makes it play 
> faster, and gets a higher pitch (and going through it slower gives it a lower 
> pitch).
> 
> The EFX extension has an effect that can change the pitch independantly of 
> playback speed (which could be used along with adjusting the playback speed 
> to get a normal pitch at faster/slower speeds), but I wouldn't expect to see 
> that effect outside of hardware implementations (neither Creative's software 
> implementation, nor OpenAL Soft, provide it). Pitch detection and 
> modification is not an easy task to do on a real-time stream without some 
> dedicated parallelism.
> 
> About the only thing I can think of to do to reasonably get the effect you 
> want is to use module files (.mod, .it, .s3m..), or MIDI files with a 
> wavetable patchset, and using a converter (like BASS/DUMB or Timidity) to 
> convert it into PCM that can be streamed through OpenAL. Unlike PCM data, 
> MIDI/MOD files are basically like sheet music.. they simply say what notes 
> should be played when and how. With "rendering" it in realtime, it can play 
> through the notes slower/faster without altering the pitch of the notes 
> themselves (assuming it has controlls to speed it up or slow it down, of 
> course).
> 
> Hope that helps.
> 
> _______________________________________________
> Openal mailing list
> Openal at opensource.creative.com
> http://opensource.creative.com/mailman/listinfo/openal

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
Url : http://opensource.creative.com/pipermail/openal/attachments/20080522/f059b8a2/signature.bin


More information about the Openal mailing list