0
0

Hi, I’m french.
How may I configure the tempo and the pitch as for fmod_channelsetfrequency ?

  • You must to post comments
0
0

Use channel->setFrequency(value * frequency_of_your_sound), for example:
value = 0.5f => 50% slower
value = 1.08f => 8% faster
or use a negative value to play backwards

If you want to increase the tempo without affecting the pitch of the sound use the built-in pitchshift dsp.

  • You must to post comments
0
0

Thank you. I would like to know how to create a dsp with pitchshift and fmod_playsound?
I could have a small example of code :

result = FMOD_System_CreateSound(system, "sound.mp3", FMOD_CREATESTREAM, sound)
ERRCHECK (result)

next …

Thank you for your help

  • You must to post comments
0
0

You’ve got:
[code:qqcvjn5c]result = FMOD_System_CreateSound(system, "sound.mp3", FMOD_CREATESTREAM, &sound);
ERRCHECK(result);[/code:qqcvjn5c]

The DSP effects are applied by channel not by sound so you’re going to need a channel and a DSP unit.

[code:qqcvjn5c]
FMOD_CHANNEL *channel;
FMOD_DSP *myDSP;

// Create the DSP effect.
result = FMOD_System_CreateDSPByType(system, FMOD_DSP_TYPE_PITCHSHIFT, &myDSP);
ERRCHECK(result);

// Then you need to set the pitch
result = FMOD_DSP_SetParameter(myDSP,0,2);
ERRCHECK(result);

// Then play the sound in the channel
result = FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sound, true, &channel);
ERRCHECK(result);

// Then apply the DSP effect to the channel
result = FMOD_Channel_AddDSP(channel, myDSP,0);
ERRCHECK(result);
[/code:qqcvjn5c]

The part using SetParameter is setting the pitch value: 0.5 to 2.0. Default = 1.0. 0.5 = one octave down, 2.0 = one octave up. 1.0 does not change the pitch.

Hope this helps,

-Pete

  • You must to post comments
0
0

Thank you very mutch.

  • You must to post comments
0
0

I have an error : DSP connection error. Couldn’t find the DSP unit specified.

  • You must to post comments
0
0

I don’t know why you’re getting DSP connection error. The code I wrote had the DSP_SetParameter after the DSP effect had been applied when actually it should of been set before being applied, this has been corrected. However i doubt that caused your error. I tested this (new) code and it works perfectly.

-Pete

  • You must to post comments
0
0

It is OK. That works perfectly now.
Thank you

  • You must to post comments
Showing 7 results
Your Answer

Please first to submit.