|
|
@ -64,28 +64,28 @@ namespace Heck::OSP { |
|
|
|
{ |
|
|
|
seed.Configure(); |
|
|
|
seed.Init(Constants::CPU_BOOST480MHZ); |
|
|
|
seed.StartLog(Constants::Developer::LOG_BLOCKS_BOOT); |
|
|
|
ld::DaisySeed::StartLog(Constants::Developer::LOG_BLOCKS_BOOT); |
|
|
|
|
|
|
|
but_rec.Init(seed.GetPin(Constants::Hardware::PIN_BUTTON_RECORD), 0); |
|
|
|
but_clear.Init(seed.GetPin(Constants::Hardware::PIN_BUTTON_CLEAR), 0); |
|
|
|
but_rec.Init(ld::DaisySeed::GetPin(Constants::Hardware::PIN_BUTTON_RECORD), 0); |
|
|
|
but_clear.Init(ld::DaisySeed::GetPin(Constants::Hardware::PIN_BUTTON_CLEAR), 0); |
|
|
|
|
|
|
|
seed.PrintLine("Setting Blocksize: %i", Constants::AUDIO_BUFFERSIZE); |
|
|
|
ld::DaisySeed::PrintLine("Setting Blocksize: %i", Constants::AUDIO_BUFFERSIZE); |
|
|
|
seed.SetAudioBlockSize(Constants::AUDIO_BUFFERSIZE); |
|
|
|
|
|
|
|
seed.PrintLine("Setting Samplerate: %i", Constants::AUDIO_SAMPLERATE); |
|
|
|
ld::DaisySeed::PrintLine("Setting Samplerate: %i", Constants::AUDIO_SAMPLERATE); |
|
|
|
seed.SetAudioSampleRate(Constants::AUDIO_SAMPLERATE); |
|
|
|
|
|
|
|
seed.PrintLine("Initializing MIDI"); |
|
|
|
ld::DaisySeed::PrintLine("Initializing MIDI"); |
|
|
|
ld::MidiUartHandler::Config midi_config{}; |
|
|
|
midi.Init(midi_config); |
|
|
|
|
|
|
|
init_tracks(); |
|
|
|
|
|
|
|
seed.PrintLine("Starting MIDI Receive"); |
|
|
|
ld::DaisySeed::PrintLine("Starting MIDI Receive"); |
|
|
|
midi.StartReceiveRt(&midi_realtime_handler); |
|
|
|
midi.Listen(); |
|
|
|
|
|
|
|
seed.PrintLine("Starting Audio"); |
|
|
|
ld::DaisySeed::PrintLine("Starting Audio"); |
|
|
|
seed.StartAudio(audio_callback); |
|
|
|
} |
|
|
|
|
|
|
@ -176,7 +176,7 @@ namespace Heck::OSP { |
|
|
|
ld::ControlChangeEvent cc = msg.AsControlChange(); |
|
|
|
if (State::clear_mode && !from_seq) { |
|
|
|
ld::ControlChangeEvent cc = msg.AsControlChange(); |
|
|
|
seed.PrintLine("Clear: ch: %i, cc: %i", cc.channel, cc.control_number); |
|
|
|
ld::DaisySeed::PrintLine("Clear: ch: %i, cc: %i", cc.channel, cc.control_number); |
|
|
|
sequencer.clear_track_cc(cc.channel, cc.control_number); |
|
|
|
} else { |
|
|
|
if (!from_seq) { |
|
|
@ -286,14 +286,14 @@ namespace Heck::OSP { |
|
|
|
bool but_rec_current = cache.read(); |
|
|
|
if (!but_rec_current) { |
|
|
|
if (State::clear_mode) { |
|
|
|
seed.PrintLine("CLEAR SEQUENCE"); |
|
|
|
ld::DaisySeed::PrintLine("CLEAR SEQUENCE"); |
|
|
|
sequencer.clear_sequence(); |
|
|
|
} else { |
|
|
|
seed.PrintLine("BUTTON RECORD ON"); |
|
|
|
ld::DaisySeed::PrintLine("BUTTON RECORD ON"); |
|
|
|
State::record_mode = true; |
|
|
|
} |
|
|
|
} else { |
|
|
|
seed.PrintLine("BUTTON RECORD OFF"); |
|
|
|
ld::DaisySeed::PrintLine("BUTTON RECORD OFF"); |
|
|
|
State::record_mode = false; |
|
|
|
} |
|
|
|
sequencer.recording = but_rec_current; |
|
|
@ -322,10 +322,10 @@ namespace Heck::OSP { |
|
|
|
{ |
|
|
|
bool but_clear_current = cache.read(); |
|
|
|
if (but_clear_current) { |
|
|
|
seed.PrintLine("BUTTON CLEAR ON"); |
|
|
|
ld::DaisySeed::PrintLine("BUTTON CLEAR ON"); |
|
|
|
State::clear_mode = true; |
|
|
|
} else { |
|
|
|
seed.PrintLine("BUTTON CLEAR OFF"); |
|
|
|
ld::DaisySeed::PrintLine("BUTTON CLEAR OFF"); |
|
|
|
State::clear_mode = false; |
|
|
|
} |
|
|
|
} |
|
|
@ -346,7 +346,7 @@ namespace Heck::OSP { |
|
|
|
|
|
|
|
void mainloop() |
|
|
|
{ |
|
|
|
seed.PrintLine("Entering MainLoop"); |
|
|
|
ld::DaisySeed::PrintLine("Entering MainLoop"); |
|
|
|
u32 uptime_ms{}; |
|
|
|
|
|
|
|
int clock_time_new{}; |
|
|
@ -373,7 +373,7 @@ namespace Heck::OSP { |
|
|
|
if (clock_bar_new != clock_bar_current) { |
|
|
|
clock_bar_current = clock_bar_new; |
|
|
|
if constexpr (Constants::Developer::LOG_CLOCK_BAR) { |
|
|
|
seed.PrintLine("Bar: %i", clock_bar_current); |
|
|
|
ld::DaisySeed::PrintLine("Bar: %i", clock_bar_current); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -381,7 +381,7 @@ namespace Heck::OSP { |
|
|
|
if (clock_16n_new != clock_16n_current) { |
|
|
|
clock_16n_current = clock_16n_new; |
|
|
|
if constexpr (Constants::Developer::LOG_CLOCK_16N) { |
|
|
|
seed.PrintLine("16n: %i", clock_16n_current); |
|
|
|
ld::DaisySeed::PrintLine("16n: %i", clock_16n_current); |
|
|
|
} |
|
|
|
sequencer.next_step(); |
|
|
|
} |
|
|
|