Visuel notes
This commit is contained in:
parent
e2fb0d911a
commit
05f8b11dec
14 changed files with 137 additions and 50 deletions
|
@ -2,7 +2,6 @@
|
|||
#include <iostream>
|
||||
#include <numeric>
|
||||
#include <random>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
|
@ -285,7 +284,7 @@ int AudioEmitter::noteSecondaire(int note) {
|
|||
*/
|
||||
std::vector<std::pair<float, int>> AudioEmitter::generateMusic() {
|
||||
std::vector<std::pair<float, int>> result;
|
||||
result.reserve(16 * AudioEmitter::nbr_melo_max);
|
||||
result.reserve(16 * nbr_melo_max);
|
||||
float beatDuration = tempo / 60.f;
|
||||
unsigned int sampleRate = 48000;
|
||||
int maxsize = 400;
|
||||
|
@ -354,9 +353,15 @@ void AudioEmitter::audioEnd() {
|
|||
system->release();
|
||||
}
|
||||
|
||||
float AudioEmitter::getTime() {
|
||||
float AudioEmitter::getTimeTempo() const {
|
||||
float beatDuration = tempo / 60.f / 8.f;
|
||||
unsigned long long dspClock = 0;
|
||||
ERRCHECK(timer->getDSPClock(&dspClock, nullptr));
|
||||
return dspClock / 48000.f / beatDuration;
|
||||
}
|
||||
|
||||
float AudioEmitter::getTime() const {
|
||||
unsigned long long dspClock = 0;
|
||||
ERRCHECK(timer->getDSPClock(&dspClock, nullptr));
|
||||
return dspClock / 48000.f;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue