Système de lecture opérationnel :)

This commit is contained in:
Raspbeguy
2014-05-21 18:08:47 +02:00
parent c08705dcb9
commit 4153a582dc
13 changed files with 152 additions and 86 deletions

View File

@@ -19,7 +19,11 @@ void supprimerInstrument(Instrument* tab[], int i){
free(tab[i]);
}
int getVolume(Instrument* inst) {
char* getChemin(Instrument* inst) {
return inst->sample->chemin;
}
int getVolumeInst(Instrument* inst) {
return inst->volume;
}
@@ -30,11 +34,16 @@ int getBalance(Instrument* inst) {
char* getNomInst(Instrument* inst) {
return inst->nom;
}
void setVolume(Instrument* inst, int volume) {
Sample* getSample(Instrument* inst) {
return inst->sample;
}
void setVolumeInst(Instrument* inst, int volume) {
inst->volume = volume;
}
void setBalance(Instrument* inst, int balance) {
void setBalanceInst(Instrument* inst, int balance) {
inst->balance = balance;
}
@@ -42,6 +51,10 @@ void setNomInst(Instrument* inst, char* nom) {
strcpy(inst->nom,nom);
}
void setSample(Instrument* inst, Sample* smpl){
inst->sample = smpl;
}
float rapportPitch(Instrument* inst, int note, int octave){
float freq = 440*pow(2,(octave-3)+(note-11)*(1.0/12.0));
return freq/(inst->sample->hauteur_ref);

View File

@@ -36,18 +36,24 @@ void ajouterInstrument(Instrument* tab[], int i);
void supprimerInstrument(Instrument* tab[], int i);
int getVolume(Instrument* inst);
char* getChemin(Instrument* inst);
int getBalance(Instrument* inst);
int getVolumeInst(Instrument* inst);
int getBalanceInst(Instrument* inst);
char* getNomInst(Instrument* inst);
Sample* getSample(Instrument* inst);
void setVolume(Instrument* inst, int volume);
void setBalance(Instrument* inst, int balance);
void setNomInst(Instrument* inst, char* nom);
void setSample(Instrument* inst, Sample* smpl);
/*
* Cette fonction prend une note et une octave en paramètre et renvoie la valeur à entrer dans le pitch shifter.
*/