0
0

Hi everybody,

We are three students in the first year of an engineering school.
We are on a project which include to change the bpm of a song and all forums recommand using FMOD.
We read the documentation but we didn’t find how to do it, may you help us please?

Thanks for all.

  • You must to post comments
0
0

you need to play the sound first then use the channel with FMOD_Channel_SetFrequency.
FMOD_System_GetMasterChannelGroup(system, &channel); is not correct. A channel is not a channelgroup. Do not get a channelgroup, then use it like a channel.
frequency is in hz, you cannot pass 50 as a frequency unless you want the sound to be inaudible.

  • You must to post comments
0
0

To france_54 :
We would like a gradual increase over time

To brett :
How can we use those fonctions?
Here it’s an extract of our code, we think we succeeded in using FMOD_DSP_TYPE_PITCHSHIFT but not the function FMOD_RESULT F_API FMOD::Channel::setFrequency ( float frequency )
[code:pjj7zui5]

int continuer = 1;
float frequency = 50.0;

FMOD_SYSTEM *system;
FMOD_SOUND *musique;
FMOD_RESULT resultat;

FMOD_System_Create(&system);
FMOD_System_Init(system, 1, FMOD_INIT_NORMAL, NULL);

/* On ouvre la musique */
resultat = FMOD_System_CreateSound(system, "track.mp3", FMOD_SOFTWARE | FMOD_2D | FMOD_CREATESTREAM, 0, &musique);

/* On vérifie si elle a bien été ouverte (IMPORTANT) */
if (resultat != FMOD_OK)
{
fprintf(stderr, "Impossible de lire le fichier mp3\n");
exit(EXIT_FAILURE);
}

/* On active la répétition de la musique à l’infini */
FMOD_Sound_SetLoopCount(musique, -1);

/on modifie la vitesse/

FMOD_DSP *pitch_shifting;
FMOD_System_CreateDSPByType(system, FMOD_DSP_TYPE_PITCHSHIFT, &pitch_shifting);
FMOD_DSP_SetParameter(pitch_shifting, 0, -50.0f);
FMOD_System_AddDSP(system, pitch_shifting, NULL);

FMOD_CHANNEL *channel;

FMOD_System_GetMasterChannelGroup(system, &channel);

FMOD_Channel_SetFrequency(channel,frequency);

/* On joue la musique */

FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, musique, 0, NULL);

while (continuer)
{

}

FMOD_Sound_Release(musique);
FMOD_System_Close(system);
FMOD_System_Release(system);

[/code:pjj7zui5]

Thanks a lot for your answers

  • You must to post comments
0
0

If you want to do minor speed up / slow down without changing the pitch of the sound, you could try a combination of FMOD_DSP_TYPE_PITCHSHIFT And inversely setting the frequency with Channel::setFrequency.

For example if you increased the pitch by 10%, then lowered the playback rate by 10% to make the pitch sound normal again, the resulting sound would play back 10% slower without a pitch change.

  • You must to post comments
0
0

Can you be more specific, are you trying to just speed up the overall BPM for example the song is at 96BPM and you wish for the song to be at 120BPM or is it that you want a gradual increase of the tempo over time?

Regards.

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.