2014-05-15 20:38:24 +02:00
|
|
|
/**
|
|
|
|
* @file instruments.h
|
|
|
|
*
|
|
|
|
* Gestion des instruments
|
|
|
|
*
|
|
|
|
* @version 1
|
|
|
|
* @author Guy
|
|
|
|
* @date Mai 2014
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2014-05-06 23:52:33 +02:00
|
|
|
#ifndef _instruments_h
|
|
|
|
#define _instruments_h
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2014-05-15 20:38:24 +02:00
|
|
|
#include <string.h>
|
|
|
|
#include <math.h>
|
2014-05-06 23:52:33 +02:00
|
|
|
#include "../samples/samples.h"
|
|
|
|
|
|
|
|
typedef struct _enveloppe {
|
|
|
|
unsigned long int tmp; // axe des temps (abscisse sur le graphe de l'enveloppe)
|
|
|
|
int volume; // axe du volume (ordonnée sur le graphe de l'enveloppe)
|
|
|
|
struct _enveloppe* suite;
|
|
|
|
} Enveloppe;
|
|
|
|
|
|
|
|
typedef struct _intrument {
|
|
|
|
Sample* sample;
|
|
|
|
Enveloppe enveloppe;
|
|
|
|
int balance;
|
|
|
|
int volume;
|
2014-05-15 20:38:24 +02:00
|
|
|
char* nom;
|
2014-05-06 23:52:33 +02:00
|
|
|
} Instrument;
|
|
|
|
|
2014-05-15 20:38:24 +02:00
|
|
|
int getVolume(Instrument* inst);
|
|
|
|
|
|
|
|
int getBalance(Instrument* inst);
|
|
|
|
|
|
|
|
char* getNomInst(Instrument* inst);
|
|
|
|
|
|
|
|
void setVolume(Instrument* inst, int volume);
|
|
|
|
|
|
|
|
void setBalance(Instrument* inst, int balance);
|
|
|
|
|
|
|
|
void setNomInst(Instrument* inst, char* nom);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Cette fonction prend une note et une octave en paramètre et renvoie la valeur à entrer dans le pitch shifter.
|
|
|
|
*/
|
|
|
|
float rapportPitch(Instrument* inst, int note, int octave);
|
2014-05-06 23:52:33 +02:00
|
|
|
|
|
|
|
#endif
|