2014-03-29 17:47:13 +01:00
|
|
|
#include "motifs.h"
|
|
|
|
|
|
|
|
void ajouterMotif(int nbrPortees, int nbrTmp){
|
|
|
|
Motif m = malloc(nbrPortees*sizeof(Portee));
|
|
|
|
int i;
|
|
|
|
for (i=0; i<nbrPortees; i++) {
|
|
|
|
m[i] = malloc(nbrTmp*sizeof(Note));
|
|
|
|
}
|
|
|
|
Liste* l = malloc(sizeof(Liste));
|
|
|
|
l->suivant = tab;
|
|
|
|
tab = l;
|
|
|
|
}
|
|
|
|
|
|
|
|
void supprimerMotif(Liste** cellule, int nbrPortees){
|
|
|
|
int i;
|
|
|
|
for (i=0; i<nbrPortees; i++) {
|
|
|
|
free((*cellule)->motif[i]);
|
|
|
|
}
|
|
|
|
free((*cellule)->motif);
|
|
|
|
Liste* aux = (*cellule)->suivant;
|
|
|
|
free((*cellule));
|
|
|
|
*cellule = aux;
|
|
|
|
}
|
2014-03-29 18:00:23 +01:00
|
|
|
|
|
|
|
void definirNote(Motif m, int portee, int tmp, int note, int octave, int instrument, int volume, int effet){
|
|
|
|
m[portee][tmp]->note=note;
|
|
|
|
m[portee][tmp]->octave=octave;
|
|
|
|
m[portee][tmp]->instrument=instrument;
|
|
|
|
m[portee][tmp]->volume=volume;
|
|
|
|
m[portee][tmp]->effet=effet;
|
|
|
|
}
|
|
|
|
|
|
|
|
void supprimerNote(Motif m, int portee, int tmp){
|
|
|
|
m[portee][tmp]->note=0;
|
|
|
|
}
|