init
This commit is contained in:
commit
f698a38c7e
585 changed files with 118338 additions and 0 deletions
34
SimpleGame/src/Include/AudioEmitter.hpp
Normal file
34
SimpleGame/src/Include/AudioEmitter.hpp
Normal 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 };
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue