2014-04-03 12:16:16 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "motifs/motifs.h"
|
|
|
|
#include "melodie/melodie.h"
|
2014-04-08 14:23:22 +02:00
|
|
|
#include "lecture/lecture.h"
|
2014-04-03 12:16:16 +02:00
|
|
|
|
|
|
|
#define DEF_NBR_TMP 16
|
2014-04-06 20:08:43 +02:00
|
|
|
#define MAX_PATTERNS 256
|
|
|
|
|
2014-04-07 16:03:08 +02:00
|
|
|
// Fonctions de débug
|
2014-04-06 20:08:43 +02:00
|
|
|
|
|
|
|
void afficherMotif(Motif* m, int nbrPortees){
|
|
|
|
printf("%s :\n",m->nom);
|
2014-04-06 20:24:35 +02:00
|
|
|
for (int tmp = 0; tmp < m->nbrTmp; tmp++){
|
|
|
|
for (int portee = 0; portee < nbrPortees; portee++){
|
|
|
|
printf("%d ",getNote(m,portee,tmp));
|
2014-04-06 20:08:43 +02:00
|
|
|
}
|
|
|
|
printf("\n");
|
|
|
|
}
|
|
|
|
}
|
2014-04-03 12:16:16 +02:00
|
|
|
|
2014-04-07 16:03:08 +02:00
|
|
|
// Fin des fonctions de débug
|
|
|
|
|
|
|
|
void debut(Motif* melodie[], Motif* liste, int nbrPortees){
|
|
|
|
ajouterMotif(&liste, DEF_NBR_TMP, nbrPortees);
|
|
|
|
Motif* m = liste;
|
|
|
|
definirNote(m,0,4,5);
|
|
|
|
definirNote(m,1,2,9);
|
|
|
|
ajouterMotif(&liste, DEF_NBR_TMP, nbrPortees);
|
|
|
|
Motif* n = liste;
|
|
|
|
definirNote(n,0,10,3);
|
|
|
|
definirNote(n,1,6,7);
|
|
|
|
ajouterMotifVirtuel(melodie,0,m);
|
|
|
|
ajouterMotifVirtuel(melodie,1,n);
|
|
|
|
ajouterMotifVirtuel(melodie,2,m);
|
|
|
|
ajouterMotifVirtuel(melodie,3,n);
|
|
|
|
}
|
|
|
|
|
2014-04-03 12:16:16 +02:00
|
|
|
int main(){
|
2014-04-06 20:08:43 +02:00
|
|
|
Motif* melodie[MAX_PATTERNS] = {NULL};
|
2014-04-03 12:16:16 +02:00
|
|
|
Motif* liste = NULL;
|
2014-04-07 16:03:08 +02:00
|
|
|
int nbrPortees = 2;
|
2014-04-06 20:08:43 +02:00
|
|
|
courant = 0;
|
|
|
|
taille = 0;
|
2014-04-07 16:03:08 +02:00
|
|
|
|
|
|
|
debut(melodie, liste, nbrPortees);
|
2014-04-08 14:23:22 +02:00
|
|
|
lecture(nbrPortee, melodie);
|
2014-04-07 16:03:08 +02:00
|
|
|
|
|
|
|
// insérer code GTK ici
|
|
|
|
|
2014-04-03 12:16:16 +02:00
|
|
|
return EXIT_SUCCESS;
|
|
|
|
}
|