This commit is contained in:
Crizomb 2025-06-10 17:40:16 +02:00
commit f698a38c7e
585 changed files with 118338 additions and 0 deletions

View file

@ -0,0 +1,34 @@
#include <fmod.hpp>
#include <fmod_errors.h>
#include <memory>
#include <vector>
class AudioEmitter {
private:
std::unique_ptr<FMOD::System> system;
FMOD::Channel* timer{ nullptr };
std::vector <std::unique_ptr<FMOD::Sound>> chords;
std::vector<std::unique_ptr<FMOD::Sound>> drums;
std::vector<std::unique_ptr<FMOD::Sound>> notes;
int tempo{ 170 };
std::vector<std::vector<float>> markov_matrix_chords;
std::vector<std::vector<float>> markov_matrix_melody;
int nbr_melo_max{ 4 };
int current_beat{ 0 };
std::vector<std::vector<float>> rythmes;
int index_note;
std::vector<int> chordProgression;
std::vector<FMOD::Channel*> activeChannels;
public:
AudioEmitter();
void generateMusic();
void audioUpdate();
void audioEnd();
int firstChord();
int nextChord(int currentChord);
int firstNote();
int nextNote(int currentNote);
int noteSecondaire(int note);
float getTime();
float timeBeforeNewGeneration{ 0.2f };
};