Commit pour la forme
This commit is contained in:
2146
sources/GUI/#ponytrackertest.glade#
Normal file
2146
sources/GUI/#ponytrackertest.glade#
Normal file
File diff suppressed because it is too large
Load Diff
@@ -96,10 +96,46 @@ void lecture (int nombreChaines, int tempo, Motif* melodie[]) {
|
||||
|
||||
|
||||
//Lecture des motifs
|
||||
for (courant = 0; courant < taille; courant++) {
|
||||
|
||||
Motif* m;
|
||||
|
||||
for (int courant = 0; courant < taille; courant++) {
|
||||
for (int i = 0; i < melodie[courant] -> nbrTmp; i++) {
|
||||
printf("lecture temps %d : N=%d I=%d\n",i,getNote(melodie[courant],0,i),getInstrument(melodie[courant],0,i));
|
||||
lireTick (system, melodie[courant], i, sample, chan, nombreChaines, tempo);
|
||||
|
||||
// D<>BUT DU COPIER COLLER POTENTIELLEMENT FOIREUX
|
||||
|
||||
m = melodie[courant]
|
||||
for (int chaine = 0; chaine < nombreChaines; chaine++) { // On va lire les chaines une <20> une par num<75>ro croissant
|
||||
if (m != NULL) {
|
||||
if (getInstrument(m,0,tmp) == -1) FMOD_Channel_Stop(chan[chaine]); // Si la note est un silence, la chaine s'arr<72>te
|
||||
else {
|
||||
|
||||
if (getNote(m,0,tmp) != 0) {
|
||||
|
||||
FMOD_Channel_Stop(chan[chaine]);
|
||||
FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, sample[getInstrument(m,chaine,tmp)], 0, &chan[chaine]);
|
||||
|
||||
//Ici on va s'occuper du pitch
|
||||
FMOD_DSP *pitch;
|
||||
FMOD_System_CreateDSPByType(system, FMOD_DSP_TYPE_PITCHSHIFT, &pitch);
|
||||
FMOD_DSP_SetParameter(pitch, FMOD_DSP_PITCHSHIFT_PITCH, 2.0);
|
||||
FMOD_Channel_AddDSP(chan[chaine], pitch, 0); // C'est quoi chan1 ??? Je l'ai remplac<61> par chan[1], vu que chan1 est as d<>clar<61>...
|
||||
// On va passer une bonne journ<72>e...
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* while (SDL_GetTicks() - tempsPrecedent < 125) {} // Si 125 ms se sont <20>coul<75>es (il faudra r<>gler ce temps sur le tempo)
|
||||
tempsPrecedent = tempsPrecedent + 125;
|
||||
Avouez que ce serait con qu'on ait besoin de SDL juste pour la temporisation
|
||||
alors qu'on peut utiliser la fonction native usleep pour <20>a, et beaucoup plus simplement. */
|
||||
usleep(60000000/tempo);
|
||||
|
||||
|
||||
// FIN DU COPIER COLLER POTENTIELLEMENT FOIREUX
|
||||
|
||||
// lireTick (system, melodie[courant], i, sample, chan, nombreChaines, tempo);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <stdio.h>
|
||||
#include "../motifs/motifs.h"
|
||||
|
||||
int courant;
|
||||
// int courant;
|
||||
|
||||
int taille;
|
||||
|
||||
|
||||
@@ -10,14 +10,6 @@
|
||||
|
||||
#include "samples.h"
|
||||
|
||||
int doitEtreSauvegarde(Sample* tab[], int i) {
|
||||
return !(tab[i]->chemin[0]=='.' && tab[i]->chemin[1]=='/');
|
||||
}
|
||||
|
||||
void setSauvegarde(Sample* tab[], int i) {
|
||||
sprintf(tab[i]->chemin,"./%d.wav",i);
|
||||
}
|
||||
|
||||
void ajouterSample(Sample* tab[], int i, char* chemin) {
|
||||
tab[i] = calloc(1,sizeof(Sample));
|
||||
sprintf(tab[i]->nom,"Sample %d",i);
|
||||
|
||||
@@ -20,7 +20,7 @@ typedef struct _sample{
|
||||
//TODO
|
||||
// Je propose un truc, mais c'est à Quentin de le compléter,
|
||||
// voire de le changer complètement.
|
||||
char chemin[500]; // contient le nom du fichier WAV (qui sera placé dans le sous-dossier samples)
|
||||
char chemin[500]; // contient le chemin du fichier WAV
|
||||
char nom[10]; // juste un nom pour qu'on puisse humainement identifier le sample
|
||||
// Infos relatives au resampling
|
||||
unsigned long int deb; // numéro de l'échantillon de début
|
||||
@@ -28,24 +28,6 @@ typedef struct _sample{
|
||||
float hauteur_ref; // fréquence de la hauteur du sample à l'état brut (sans repitching)
|
||||
} Sample;
|
||||
|
||||
/**
|
||||
* Il s'agit de définir une liste des samples à supprimer lors de la prochaine sauvegarde.
|
||||
*/
|
||||
typedef struct _poubelle{
|
||||
char chemin[500];
|
||||
struct _poubelle* suiv;
|
||||
} Poubelle;
|
||||
|
||||
/**
|
||||
* Cette fonction à valeur booléenne détermine si le fichier doit être copié dans le dossier de sauvegarde.
|
||||
*/
|
||||
int doitEtreSauvegarde(Sample* tab[], int i);
|
||||
|
||||
/**
|
||||
* Cette procédure définit le statut du fichier comme déjà copié dans la sauvegarde.
|
||||
*/
|
||||
void setSauvegarde(Sample* tab[], int i);
|
||||
|
||||
void ajouterSample(Sample* tab[], int i, char* chemin);
|
||||
|
||||
void supprimerSample(Sample* tab[], int i, Poubelle** poub);
|
||||
|
||||
Reference in New Issue
Block a user