65 for (
int k = 0; k < nombreInst; k++) {
69 fprintf(stderr,
"Impossible de lire le fichier audio\n");
116 for (
int courant = 0; courant <
taille; courant++) {
117 for (
int i = 0; i < melodie[courant] -> nbrTmp; i++) {
121 m = melodie[courant];
122 for (
int chaine = 0; chaine < nombreChaines; chaine++) {
127 if (
getNote(m,chaine,i) != -1) {
135 FMOD_DSP_SetParameter(pitch,
FMOD_DSP_PITCHSHIFT_PITCH,
rapportPitch(inst[
getInstrument(m,chaine,i)],
getNote(m,chaine,i),
getOctave(m,chaine,i)));
146 usleep(60000000/tempo);
156 for (
int i = 0; i < nombreInst; i++) {
FMOD_RESULT F_API FMOD_System_PlaySound(FMOD_SYSTEM *system, FMOD_CHANNELINDEX channelid, FMOD_SOUND *sound, FMOD_BOOL paused, FMOD_CHANNEL **channel)
int getInstrument(Motif *m, int portee, int tmp)
int getNote(Motif *m, int portee, int tmp)
Instrument * inst[NBR_INST]
float rapportPitch(Instrument *inst, int note, int octave)
struct FMOD_SOUND FMOD_SOUND
FMOD_RESULT F_API FMOD_System_CreateDSPByType(FMOD_SYSTEM *system, FMOD_DSP_TYPE type, FMOD_DSP **dsp)
FMOD_RESULT F_API FMOD_Channel_Stop(FMOD_CHANNEL *channel)
char * getChemin(Instrument *inst)
FMOD_RESULT F_API FMOD_System_Create(FMOD_SYSTEM **system)
struct FMOD_CHANNEL FMOD_CHANNEL
struct FMOD_SYSTEM FMOD_SYSTEM
FMOD_RESULT F_API FMOD_DSP_SetParameter(FMOD_DSP *dsp, int index, float value)
FMOD_RESULT F_API FMOD_System_Init(FMOD_SYSTEM *system, int maxchannels, FMOD_INITFLAGS flags, void *extradriverdata)
FMOD_RESULT F_API FMOD_Sound_Release(FMOD_SOUND *sound)
void lecture(int nombreChaines, int nombreInst, int tempo, Instrument *inst[], Motif *melodie[])
FMOD_RESULT F_API FMOD_System_Release(FMOD_SYSTEM *system)
Motif * melodie[MAX_PATTERNS]
FMOD_RESULT F_API FMOD_System_Close(FMOD_SYSTEM *system)
FMOD_RESULT F_API FMOD_System_CreateStream(FMOD_SYSTEM *system, const char *name_or_data, FMOD_MODE mode, FMOD_CREATESOUNDEXINFO *exinfo, FMOD_SOUND **sound)
FMOD_RESULT F_API FMOD_Channel_AddDSP(FMOD_CHANNEL *channel, FMOD_DSP *dsp, FMOD_DSPCONNECTION **connection)
int getOctave(Motif *m, int portee, int tmp)