From 2e793141e5434043205763c70d3a597cf2d78eeb Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Sat, 4 Jan 2025 17:51:59 +0100 Subject: Separate clocks --- NoteClick.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 NoteClick.cpp (limited to 'NoteClick.cpp') diff --git a/NoteClick.cpp b/NoteClick.cpp new file mode 100644 index 0000000..657a893 --- /dev/null +++ b/NoteClick.cpp @@ -0,0 +1,20 @@ +#include "NoteClick.h" + +NoteClick::NoteClick(Config& config): + m_config(config), + m_detect(1) +{ + m_detect.signal_bpm.connect([&](int bpm){signal_bpm(bpm);}); +} + +// slots +void NoteClick::receive_note(int channel, int note, uint64_t timestamp) +{ + (void) timestamp; + + if (channel == m_config.get_midi_channel() && note == m_config.get_midi_note()) { + signal_click(); + m_detect.receive_event(); + } +} + -- cgit v1.2.3