diff --git a/src/MidiController.cpp b/src/MidiController.cpp index 88b7d59..3f4debd 100644 --- a/src/MidiController.cpp +++ b/src/MidiController.cpp @@ -82,5 +82,4 @@ void MidiController::handleMessage(const std::vector& msg) { }); } - std::cout << "MidiHandleMessage start (0)" << std::endl; } \ No newline at end of file diff --git a/src/NoteQueue.cpp b/src/NoteQueue.cpp index 0655a6b..e86617f 100644 --- a/src/NoteQueue.cpp +++ b/src/NoteQueue.cpp @@ -11,8 +11,6 @@ bool NoteQueue::push(const NoteEvent& event) { buffer_[head] = event; head_.store(next, std::memory_order_relaxed); - std::cout << "Notequeue::push: " << std::chrono::duration_cast(std::chrono::high_resolution_clock::now() - event.timestamp) << std::endl; - return true; } @@ -24,7 +22,5 @@ bool NoteQueue::pop(NoteEvent& event) { event = buffer_[tail]; tail_.store((tail + 1) % SIZE, std::memory_order_release); - std::cout << "Notequeue::pop: " << std::chrono::duration_cast(std::chrono::high_resolution_clock::now() - event.timestamp) << std::endl; - return true; } diff --git a/src/synth/AudioEngine.h b/src/synth/AudioEngine.h index a51f21b..a66c51f 100644 --- a/src/synth/AudioEngine.h +++ b/src/synth/AudioEngine.h @@ -8,6 +8,12 @@ #include "Synth.h" #include "../KeyboardController.h" +#if defined(_WIN32) + #define AUDIO_API RtAudio::WINDOWS_WASAPI +#else + #define AUDIO_API RtAudio::LINUX_ALSA +#endif + class AudioEngine { public: @@ -38,10 +44,10 @@ private: Synth synth_; // generates audio ScopeBuffer scope_ { 1024 }; // stores audio samples for visualization - RtAudio audio_; // audio device + RtAudio audio_{AUDIO_API}; // audio device // TODO: id like a yml config file or something for these uint32_t sampleRate_ = 44100; - uint32_t bufferFrames_ = 128; // time per buffer = BF/SR (256/44100 = 5.8ms) + uint32_t bufferFrames_ = 256; // time per buffer = BF/SR (256/44100 = 5.8ms) uint32_t channels_ = 2; // stereo }; diff --git a/src/synth/Synth.cpp b/src/synth/Synth.cpp index 2e25212..f0bff9d 100644 --- a/src/synth/Synth.cpp +++ b/src/synth/Synth.cpp @@ -32,7 +32,6 @@ inline float Synth::getParam(ParamId id) { void Synth::handleNoteEvent(const NoteEvent& event) { - std::cout << "Synth::handleNoteEvent: " << std::chrono::duration_cast(std::chrono::high_resolution_clock::now() - event.timestamp) << std::endl; lastTime = event.timestamp; if(event.type == NoteEventType::NoteOn) { @@ -110,6 +109,4 @@ void Synth::process(float* out, uint32_t nFrames, uint32_t sampleRate) { } } - //std::cout << "Notequeue::push: " << std::chrono::high_resolution_clock::now() - lastTime << std::endl; - } \ No newline at end of file