From e35bd20445fa2efbea46aa1450cb8a3bd486df7e Mon Sep 17 00:00:00 2001 From: mebitek Date: Tue, 14 May 2024 07:52:54 +0200 Subject: [PATCH 1/9] clean code --- .../sequencer/ui/controllers/launchpad/LaunchpadController.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/apps/sequencer/ui/controllers/launchpad/LaunchpadController.cpp b/src/apps/sequencer/ui/controllers/launchpad/LaunchpadController.cpp index 891613e2..16824fd4 100644 --- a/src/apps/sequencer/ui/controllers/launchpad/LaunchpadController.cpp +++ b/src/apps/sequencer/ui/controllers/launchpad/LaunchpadController.cpp @@ -596,7 +596,8 @@ void LaunchpadController::sequenceButton(const Button &button, ButtonAction acti } auto &sequence = _project.selectedStochasticSequence(); sequence.step(selectedNote).toggleGate(); - sequence.step(selectedNote).setNoteOctave(selectedOctave); } + sequence.step(selectedNote).setNoteOctave(selectedOctave); + } break; } case Track::TrackMode::Arp: { From 635bcd41aa2ec6a03ad392702dbfaf0e96e8423f Mon Sep 17 00:00:00 2001 From: mebitek Date: Tue, 14 May 2024 07:56:24 +0200 Subject: [PATCH 2/9] =?UTF-8?q?issue=20#116=20F1-F5=20button=20men=C3=BCs?= =?UTF-8?q?=20crash?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apps/sequencer/ui/pages/ArpSequenceEditPage.cpp | 1 - src/apps/sequencer/ui/pages/ArpSequencePage.cpp | 1 - src/apps/sequencer/ui/pages/CurveSequenceEditPage.cpp | 1 - src/apps/sequencer/ui/pages/CurveSequencePage.cpp | 1 - src/apps/sequencer/ui/pages/LayoutPage.cpp | 2 -- src/apps/sequencer/ui/pages/LogicSequenceEditPage.cpp | 2 -- src/apps/sequencer/ui/pages/LogicSequencePage.cpp | 1 - src/apps/sequencer/ui/pages/MidiOutputPage.cpp | 2 -- src/apps/sequencer/ui/pages/NoteSequenceEditPage.cpp | 2 -- src/apps/sequencer/ui/pages/NoteSequencePage.cpp | 2 -- src/apps/sequencer/ui/pages/OverviewPage.cpp | 2 -- src/apps/sequencer/ui/pages/PatternPage.cpp | 2 -- src/apps/sequencer/ui/pages/PerformerPage.cpp | 2 -- src/apps/sequencer/ui/pages/ProjectPage.cpp | 2 -- src/apps/sequencer/ui/pages/RoutingPage.cpp | 2 -- src/apps/sequencer/ui/pages/SongPage.cpp | 2 -- src/apps/sequencer/ui/pages/StochasticSequenceEditPage.cpp | 2 -- src/apps/sequencer/ui/pages/StochasticSequencePage.cpp | 2 -- src/apps/sequencer/ui/pages/TrackPage.cpp | 2 -- src/apps/sequencer/ui/pages/UserScalePage.cpp | 2 -- 20 files changed, 35 deletions(-) diff --git a/src/apps/sequencer/ui/pages/ArpSequenceEditPage.cpp b/src/apps/sequencer/ui/pages/ArpSequenceEditPage.cpp index ae8b9c10..e33fbbdd 100644 --- a/src/apps/sequencer/ui/pages/ArpSequenceEditPage.cpp +++ b/src/apps/sequencer/ui/pages/ArpSequenceEditPage.cpp @@ -479,7 +479,6 @@ void ArpSequenceEditPage::keyPress(KeyPressEvent &event) { auto &sequence = _project.selectedArpSequence(); auto &track = _project.selectedTrack().arpTrack(); - functionShortcuts(event); if (key.isContextMenu()) { contextShow(); diff --git a/src/apps/sequencer/ui/pages/ArpSequencePage.cpp b/src/apps/sequencer/ui/pages/ArpSequencePage.cpp index e8f91145..c52ee28b 100644 --- a/src/apps/sequencer/ui/pages/ArpSequencePage.cpp +++ b/src/apps/sequencer/ui/pages/ArpSequencePage.cpp @@ -67,7 +67,6 @@ void ArpSequencePage::updateLeds(Leds &leds) { void ArpSequencePage::keyPress(KeyPressEvent &event) { const auto &key = event.key(); - functionShortcuts(event); if (key.shiftModifier() && event.count() == 2) { saveContextShow(); diff --git a/src/apps/sequencer/ui/pages/CurveSequenceEditPage.cpp b/src/apps/sequencer/ui/pages/CurveSequenceEditPage.cpp index ff496275..fede5889 100644 --- a/src/apps/sequencer/ui/pages/CurveSequenceEditPage.cpp +++ b/src/apps/sequencer/ui/pages/CurveSequenceEditPage.cpp @@ -344,7 +344,6 @@ void CurveSequenceEditPage::keyPress(KeyPressEvent &event) { auto &sequence = _project.selectedCurveSequence(); auto &track = _project.selectedTrack().curveTrack(); - functionShortcuts(event); if (key.isContextMenu()) { contextShow(); diff --git a/src/apps/sequencer/ui/pages/CurveSequencePage.cpp b/src/apps/sequencer/ui/pages/CurveSequencePage.cpp index dd2beb86..e136a1dd 100644 --- a/src/apps/sequencer/ui/pages/CurveSequencePage.cpp +++ b/src/apps/sequencer/ui/pages/CurveSequencePage.cpp @@ -65,7 +65,6 @@ void CurveSequencePage::updateLeds(Leds &leds) { void CurveSequencePage::keyPress(KeyPressEvent &event) { const auto &key = event.key(); - functionShortcuts(event); if (key.shiftModifier() && event.count() == 2) { saveContextShow(); diff --git a/src/apps/sequencer/ui/pages/LayoutPage.cpp b/src/apps/sequencer/ui/pages/LayoutPage.cpp index 33613a35..d75300a7 100644 --- a/src/apps/sequencer/ui/pages/LayoutPage.cpp +++ b/src/apps/sequencer/ui/pages/LayoutPage.cpp @@ -35,8 +35,6 @@ void LayoutPage::draw(Canvas &canvas) { void LayoutPage::keyPress(KeyPressEvent &event) { const auto &key = event.key(); - //functionShortcuts(event); - if (key.isFunction()) { if (key.function() == 4 && _mode == Mode::TrackMode && !_trackModeListModel.sameAsProject(_project)) { _manager.pages().confirmation.show("ARE YOU SURE?", [this] (bool result) { diff --git a/src/apps/sequencer/ui/pages/LogicSequenceEditPage.cpp b/src/apps/sequencer/ui/pages/LogicSequenceEditPage.cpp index 12085d69..f2c48afe 100644 --- a/src/apps/sequencer/ui/pages/LogicSequenceEditPage.cpp +++ b/src/apps/sequencer/ui/pages/LogicSequenceEditPage.cpp @@ -399,8 +399,6 @@ void LogicSequenceEditPage::keyPress(KeyPressEvent &event) { auto &sequence = _project.selectedLogicSequence(); auto &track = _project.selectedTrack().logicTrack(); - functionShortcuts(event); - if (key.isContextMenu()) { contextShow(); event.consume(); diff --git a/src/apps/sequencer/ui/pages/LogicSequencePage.cpp b/src/apps/sequencer/ui/pages/LogicSequencePage.cpp index 475e0b86..56a45828 100644 --- a/src/apps/sequencer/ui/pages/LogicSequencePage.cpp +++ b/src/apps/sequencer/ui/pages/LogicSequencePage.cpp @@ -67,7 +67,6 @@ void LogicSequencePage::updateLeds(Leds &leds) { void LogicSequencePage::keyPress(KeyPressEvent &event) { const auto &key = event.key(); - functionShortcuts(event); if (key.shiftModifier() && event.count() == 2) { saveContextShow(); diff --git a/src/apps/sequencer/ui/pages/MidiOutputPage.cpp b/src/apps/sequencer/ui/pages/MidiOutputPage.cpp index 796f0306..e3c7b870 100644 --- a/src/apps/sequencer/ui/pages/MidiOutputPage.cpp +++ b/src/apps/sequencer/ui/pages/MidiOutputPage.cpp @@ -47,8 +47,6 @@ void MidiOutputPage::draw(Canvas &canvas) { void MidiOutputPage::keyPress(KeyPressEvent &event) { const auto &key = event.key(); - //functionShortcuts(event); - if (key.isFunction()) { switch (Function(key.function())) { case Function::Prev: diff --git a/src/apps/sequencer/ui/pages/NoteSequenceEditPage.cpp b/src/apps/sequencer/ui/pages/NoteSequenceEditPage.cpp index 79f7655b..406803e4 100644 --- a/src/apps/sequencer/ui/pages/NoteSequenceEditPage.cpp +++ b/src/apps/sequencer/ui/pages/NoteSequenceEditPage.cpp @@ -364,8 +364,6 @@ void NoteSequenceEditPage::keyPress(KeyPressEvent &event) { auto &sequence = _project.selectedNoteSequence(); auto &track = _project.selectedTrack().noteTrack(); - functionShortcuts(event); - auto &trackEngine = _engine.selectedTrackEngine().as(); if (key.isContextMenu()) { diff --git a/src/apps/sequencer/ui/pages/NoteSequencePage.cpp b/src/apps/sequencer/ui/pages/NoteSequencePage.cpp index d497957c..6de137eb 100644 --- a/src/apps/sequencer/ui/pages/NoteSequencePage.cpp +++ b/src/apps/sequencer/ui/pages/NoteSequencePage.cpp @@ -67,8 +67,6 @@ void NoteSequencePage::updateLeds(Leds &leds) { void NoteSequencePage::keyPress(KeyPressEvent &event) { const auto &key = event.key(); - functionShortcuts(event); - if (key.shiftModifier() && event.count() == 2) { saveContextShow(); event.consume(); diff --git a/src/apps/sequencer/ui/pages/OverviewPage.cpp b/src/apps/sequencer/ui/pages/OverviewPage.cpp index d7375607..dca783c7 100644 --- a/src/apps/sequencer/ui/pages/OverviewPage.cpp +++ b/src/apps/sequencer/ui/pages/OverviewPage.cpp @@ -563,8 +563,6 @@ void OverviewPage::keyUp(KeyEvent &event) { void OverviewPage::keyPress(KeyPressEvent &event) { const auto &key = event.key(); - functionShortcuts(event); - if (key.isGlobal()) { return; } diff --git a/src/apps/sequencer/ui/pages/PatternPage.cpp b/src/apps/sequencer/ui/pages/PatternPage.cpp index 64480c14..6f936e0a 100644 --- a/src/apps/sequencer/ui/pages/PatternPage.cpp +++ b/src/apps/sequencer/ui/pages/PatternPage.cpp @@ -226,8 +226,6 @@ void PatternPage::keyUp(KeyEvent &event) { void PatternPage::keyPress(KeyPressEvent &event) { const auto &key = event.key(); - - functionShortcuts(event); auto &playState = _project.playState(); diff --git a/src/apps/sequencer/ui/pages/PerformerPage.cpp b/src/apps/sequencer/ui/pages/PerformerPage.cpp index c9028986..c33a45a1 100644 --- a/src/apps/sequencer/ui/pages/PerformerPage.cpp +++ b/src/apps/sequencer/ui/pages/PerformerPage.cpp @@ -193,8 +193,6 @@ void PerformerPage::keyUp(KeyEvent &event) { void PerformerPage::keyPress(KeyPressEvent &event) { const auto &key = event.key(); - functionShortcuts(event); - auto &playState = _project.playState(); if (key.pageModifier()) { diff --git a/src/apps/sequencer/ui/pages/ProjectPage.cpp b/src/apps/sequencer/ui/pages/ProjectPage.cpp index 5c054226..3779aebc 100644 --- a/src/apps/sequencer/ui/pages/ProjectPage.cpp +++ b/src/apps/sequencer/ui/pages/ProjectPage.cpp @@ -65,8 +65,6 @@ void ProjectPage::keyPress(KeyPressEvent &event) { return; } - //functionShortcuts(event); - if (key.pageModifier()) { // easter egg if (key.is(Key::Step15)) { diff --git a/src/apps/sequencer/ui/pages/RoutingPage.cpp b/src/apps/sequencer/ui/pages/RoutingPage.cpp index 28435440..10e53261 100644 --- a/src/apps/sequencer/ui/pages/RoutingPage.cpp +++ b/src/apps/sequencer/ui/pages/RoutingPage.cpp @@ -53,8 +53,6 @@ void RoutingPage::draw(Canvas &canvas) { void RoutingPage::keyPress(KeyPressEvent &event) { const auto &key = event.key(); - //functionShortcuts(event); - if (edit() && selectedRow() == int(RouteListModel::Item::Tracks) && key.isTrack()) { _editRoute.toggleTrack(key.track()); event.consume(); diff --git a/src/apps/sequencer/ui/pages/SongPage.cpp b/src/apps/sequencer/ui/pages/SongPage.cpp index 533f218f..2dbaa7d1 100644 --- a/src/apps/sequencer/ui/pages/SongPage.cpp +++ b/src/apps/sequencer/ui/pages/SongPage.cpp @@ -218,8 +218,6 @@ void SongPage::keyPress(KeyPressEvent &event) { auto &playState = _project.playState(); uint8_t selectedTracks = pressedTrackKeys(); - functionShortcuts(event); - if (key.isContextMenu()) { contextShow(); event.consume(); diff --git a/src/apps/sequencer/ui/pages/StochasticSequenceEditPage.cpp b/src/apps/sequencer/ui/pages/StochasticSequenceEditPage.cpp index c7a20f32..2fd0e75e 100644 --- a/src/apps/sequencer/ui/pages/StochasticSequenceEditPage.cpp +++ b/src/apps/sequencer/ui/pages/StochasticSequenceEditPage.cpp @@ -386,8 +386,6 @@ void StochasticSequenceEditPage::keyPress(KeyPressEvent &event) { const auto &key = event.key(); auto &sequence = _project.selectedStochasticSequence(); - functionShortcuts(event); - if (key.isContextMenu()) { contextShow(); event.consume(); diff --git a/src/apps/sequencer/ui/pages/StochasticSequencePage.cpp b/src/apps/sequencer/ui/pages/StochasticSequencePage.cpp index 6a8e6739..87f935ae 100644 --- a/src/apps/sequencer/ui/pages/StochasticSequencePage.cpp +++ b/src/apps/sequencer/ui/pages/StochasticSequencePage.cpp @@ -53,8 +53,6 @@ void StochasticSequencePage::updateLeds(Leds &leds) { void StochasticSequencePage::keyPress(KeyPressEvent &event) { const auto &key = event.key(); - functionShortcuts(event); - if (key.isContextMenu()) { contextShow(); event.consume(); diff --git a/src/apps/sequencer/ui/pages/TrackPage.cpp b/src/apps/sequencer/ui/pages/TrackPage.cpp index 632a1851..d796f797 100644 --- a/src/apps/sequencer/ui/pages/TrackPage.cpp +++ b/src/apps/sequencer/ui/pages/TrackPage.cpp @@ -51,8 +51,6 @@ void TrackPage::updateLeds(Leds &leds) { void TrackPage::keyPress(KeyPressEvent &event) { const auto &key = event.key(); - functionShortcuts(event); - if (key.isContextMenu()) { contextShow(); event.consume(); diff --git a/src/apps/sequencer/ui/pages/UserScalePage.cpp b/src/apps/sequencer/ui/pages/UserScalePage.cpp index 636ce9f1..1d41d4fa 100644 --- a/src/apps/sequencer/ui/pages/UserScalePage.cpp +++ b/src/apps/sequencer/ui/pages/UserScalePage.cpp @@ -49,8 +49,6 @@ void UserScalePage::draw(Canvas &canvas) { void UserScalePage::keyPress(KeyPressEvent &event) { const auto &key = event.key(); - //functionShortcuts(event); - if (key.isContextMenu()) { contextShow(); event.consume(); From c5ddde9d8e2ecd8b2532c487e026d67cae99182f Mon Sep 17 00:00:00 2001 From: mebitek Date: Tue, 14 May 2024 08:02:10 +0200 Subject: [PATCH 3/9] issue #115 Follow Display is not saved with project --- src/apps/sequencer/model/ArpTrack.cpp | 2 ++ src/apps/sequencer/model/CurveTrack.cpp | 2 ++ src/apps/sequencer/model/LogicTrack.cpp | 2 ++ src/apps/sequencer/model/NoteTrack.cpp | 2 ++ src/apps/sequencer/model/ProjectVersion.h | 3 +++ 5 files changed, 11 insertions(+) diff --git a/src/apps/sequencer/model/ArpTrack.cpp b/src/apps/sequencer/model/ArpTrack.cpp index 003559fd..7c0b593d 100644 --- a/src/apps/sequencer/model/ArpTrack.cpp +++ b/src/apps/sequencer/model/ArpTrack.cpp @@ -67,6 +67,7 @@ void ArpTrack::write(VersionedSerializedWriter &writer) const { writer.write(_noteProbabilityBias.base); writer.write(_arpeggiator); writeArray(writer, _sequences); + writer.write(_patternFollow); } void ArpTrack::read(VersionedSerializedReader &reader) { @@ -94,4 +95,5 @@ void ArpTrack::read(VersionedSerializedReader &reader) { } readArray(reader, _sequences); + reader.read(_patternFollow, ProjectVersion::Version39); } diff --git a/src/apps/sequencer/model/CurveTrack.cpp b/src/apps/sequencer/model/CurveTrack.cpp index a073a893..2a6f6bdf 100644 --- a/src/apps/sequencer/model/CurveTrack.cpp +++ b/src/apps/sequencer/model/CurveTrack.cpp @@ -63,6 +63,7 @@ void CurveTrack::write(VersionedSerializedWriter &writer) const { writer.write(_min); writer.write(_max); writeArray(writer, _sequences); + writer.write(_patternFollow); } void CurveTrack::read(VersionedSerializedReader &reader) { @@ -79,4 +80,5 @@ void CurveTrack::read(VersionedSerializedReader &reader) { reader.read(_min, ProjectVersion::Version37); reader.read(_max, ProjectVersion::Version37); readArray(reader, _sequences); + reader.read(_patternFollow, ProjectVersion::Version39); } diff --git a/src/apps/sequencer/model/LogicTrack.cpp b/src/apps/sequencer/model/LogicTrack.cpp index 647f68d6..565c133c 100644 --- a/src/apps/sequencer/model/LogicTrack.cpp +++ b/src/apps/sequencer/model/LogicTrack.cpp @@ -74,6 +74,7 @@ void LogicTrack::write(VersionedSerializedWriter &writer) const { writer.write(_inputTrack2); writer.write(_detailedView); writeArray(writer, _sequences); + writer.write(_patternFollow); } void LogicTrack::read(VersionedSerializedReader &reader) { @@ -105,4 +106,5 @@ void LogicTrack::read(VersionedSerializedReader &reader) { } readArray(reader, _sequences); + reader.read(_patternFollow, ProjectVersion::Version39); } diff --git a/src/apps/sequencer/model/NoteTrack.cpp b/src/apps/sequencer/model/NoteTrack.cpp index 61f1da0b..24622bb3 100644 --- a/src/apps/sequencer/model/NoteTrack.cpp +++ b/src/apps/sequencer/model/NoteTrack.cpp @@ -72,6 +72,7 @@ void NoteTrack::write(VersionedSerializedWriter &writer) const { writer.write(_logicTrack); writer.write(_logicTrackInput); writeArray(writer, _sequences); + writer.write(_patternFollow); } void NoteTrack::read(VersionedSerializedReader &reader) { @@ -101,4 +102,5 @@ void NoteTrack::read(VersionedSerializedReader &reader) { } readArray(reader, _sequences); + reader.read(_patternFollow, ProjectVersion::Version39); } diff --git a/src/apps/sequencer/model/ProjectVersion.h b/src/apps/sequencer/model/ProjectVersion.h index 84af8e25..acb39182 100644 --- a/src/apps/sequencer/model/ProjectVersion.h +++ b/src/apps/sequencer/model/ProjectVersion.h @@ -111,6 +111,9 @@ enum ProjectVersion { // add arp track and malekko integration Version38 = 38, + // add pattern follow + Version39 = 39, + // automatically derive latest version Last, From 99e4f5b56f8a5594b8fa09eee12c835f701ea903 Mon Sep 17 00:00:00 2001 From: mebitek Date: Mon, 20 May 2024 08:25:27 +0200 Subject: [PATCH 4/9] issue #117: Curved cv input problem - add option to disable multi cv recording --- src/apps/sequencer/engine/CurveTrackEngine.cpp | 7 ++++++- src/apps/sequencer/model/CurveTrack.cpp | 3 +++ src/apps/sequencer/model/CurveTrack.h | 17 +++++++++++++++++ .../sequencer/ui/model/CurveTrackListModel.h | 8 ++++++++ 4 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/apps/sequencer/engine/CurveTrackEngine.cpp b/src/apps/sequencer/engine/CurveTrackEngine.cpp index e4f3e960..0761c33a 100644 --- a/src/apps/sequencer/engine/CurveTrackEngine.cpp +++ b/src/apps/sequencer/engine/CurveTrackEngine.cpp @@ -240,11 +240,16 @@ void CurveTrackEngine::updateOutput(uint32_t relativeTick, uint32_t divisor) { } bool CurveTrackEngine::isRecording() const { - return + bool val = _engine.state().recording() && _curveTrack.curveCvInput() != Types::CurveCvInput::Off; //&& //_model.project().selectedTrackIndex() == _track.trackIndex(); + + if (!_track.curveTrack().useMultiCvRec()) { + return val && _model.project().selectedTrackIndex() == _track.trackIndex(); + } + return val; } void CurveTrackEngine::updateRecordValue() { diff --git a/src/apps/sequencer/model/CurveTrack.cpp b/src/apps/sequencer/model/CurveTrack.cpp index 2a6f6bdf..c599a264 100644 --- a/src/apps/sequencer/model/CurveTrack.cpp +++ b/src/apps/sequencer/model/CurveTrack.cpp @@ -42,6 +42,7 @@ void CurveTrack::clear() { setCurveCvInput(Types::CurveCvInput::Off); setMin(0); setMax(CurveSequence::Max::max()); + setUseMultiCvRec(true); for (auto &sequence : _sequences) { sequence.clear(); @@ -64,6 +65,7 @@ void CurveTrack::write(VersionedSerializedWriter &writer) const { writer.write(_max); writeArray(writer, _sequences); writer.write(_patternFollow); + writer.write(_useMultiCv); } void CurveTrack::read(VersionedSerializedReader &reader) { @@ -81,4 +83,5 @@ void CurveTrack::read(VersionedSerializedReader &reader) { reader.read(_max, ProjectVersion::Version37); readArray(reader, _sequences); reader.read(_patternFollow, ProjectVersion::Version39); + reader.read(_useMultiCv, ProjectVersion::Version39); } diff --git a/src/apps/sequencer/model/CurveTrack.h b/src/apps/sequencer/model/CurveTrack.h index 1fa89ebb..47beb84e 100644 --- a/src/apps/sequencer/model/CurveTrack.h +++ b/src/apps/sequencer/model/CurveTrack.h @@ -214,6 +214,22 @@ class CurveTrack : public BaseTrack, public BaseTrackPatternFollow { str(Types::curveCvInput(_curveCvInput)); } + // use multi cv recording + bool useMultiCvRec() const { return _useMultiCv;} + + void editUseMultiCvRec(int value) { + _useMultiCv = value == 1; + } + + void printUseMultiCvRec(StringBuilder &str) const { + if (_useMultiCv) str("On"); + else str("Off"); + } + + void setUseMultiCvRec(bool enabled) { + _useMultiCv = enabled; + } + // min float min() const { return _min.get(isRouted(Routing::Target::CurveMin)); } @@ -305,6 +321,7 @@ class CurveTrack : public BaseTrack, public BaseTrackPatternFollow { Routable _max; Types::CurveCvInput _curveCvInput; + bool _useMultiCv; CurveSequenceArray _sequences; diff --git a/src/apps/sequencer/ui/model/CurveTrackListModel.h b/src/apps/sequencer/ui/model/CurveTrackListModel.h index 34ed78c7..ad55f23d 100644 --- a/src/apps/sequencer/ui/model/CurveTrackListModel.h +++ b/src/apps/sequencer/ui/model/CurveTrackListModel.h @@ -64,6 +64,7 @@ class CurveTrackListModel : public RoutableListModel { GateProbabilityBias, PatternFollow, CurveCvInput, + MultiCvRec, Min, Max, Last @@ -81,6 +82,7 @@ class CurveTrackListModel : public RoutableListModel { case ShapeProbabilityBias: return "Shape P. Bias"; case GateProbabilityBias: return "Gate P. Bias"; case PatternFollow: return "Pattern Follow"; + case MultiCvRec: return "Multi Cv Rec"; case CurveCvInput: return "Curve CV Input"; case Min: return "Min"; case Max: return "Max"; @@ -125,6 +127,9 @@ class CurveTrackListModel : public RoutableListModel { case PatternFollow: _track->printPatternFollow(str); break; + case MultiCvRec: + _track->printUseMultiCvRec(str); + break; case CurveCvInput: _track->printCurveCvInput(str); break; @@ -170,6 +175,9 @@ class CurveTrackListModel : public RoutableListModel { case PatternFollow: _track->editPatternFollow(value, shift); break; + case MultiCvRec: + _track->editUseMultiCvRec(value); + break; case CurveCvInput: _track->editCurveCvInput(value, shift); break; From 5cb14168815a9bc7b1a340ab54a27379095a67be Mon Sep 17 00:00:00 2001 From: mebitek Date: Mon, 20 May 2024 08:31:08 +0200 Subject: [PATCH 5/9] issue #117: Curved cv input problem - add option to disable multi cv recording --- src/apps/sequencer/engine/CurveTrackEngine.cpp | 4 +--- src/apps/sequencer/model/CurveTrack.cpp | 3 --- src/apps/sequencer/model/CurveTrack.h | 17 ----------------- src/apps/sequencer/model/Project.cpp | 3 +++ src/apps/sequencer/model/Project.h | 18 ++++++++++++++++++ .../sequencer/ui/model/CurveTrackListModel.h | 8 -------- src/apps/sequencer/ui/model/ProjectListModel.h | 8 ++++++++ 7 files changed, 30 insertions(+), 31 deletions(-) diff --git a/src/apps/sequencer/engine/CurveTrackEngine.cpp b/src/apps/sequencer/engine/CurveTrackEngine.cpp index 0761c33a..b26bd1f7 100644 --- a/src/apps/sequencer/engine/CurveTrackEngine.cpp +++ b/src/apps/sequencer/engine/CurveTrackEngine.cpp @@ -243,10 +243,8 @@ bool CurveTrackEngine::isRecording() const { bool val = _engine.state().recording() && _curveTrack.curveCvInput() != Types::CurveCvInput::Off; - //&& - //_model.project().selectedTrackIndex() == _track.trackIndex(); - if (!_track.curveTrack().useMultiCvRec()) { + if (!_model.project().useMultiCvRec()) { return val && _model.project().selectedTrackIndex() == _track.trackIndex(); } return val; diff --git a/src/apps/sequencer/model/CurveTrack.cpp b/src/apps/sequencer/model/CurveTrack.cpp index c599a264..2a6f6bdf 100644 --- a/src/apps/sequencer/model/CurveTrack.cpp +++ b/src/apps/sequencer/model/CurveTrack.cpp @@ -42,7 +42,6 @@ void CurveTrack::clear() { setCurveCvInput(Types::CurveCvInput::Off); setMin(0); setMax(CurveSequence::Max::max()); - setUseMultiCvRec(true); for (auto &sequence : _sequences) { sequence.clear(); @@ -65,7 +64,6 @@ void CurveTrack::write(VersionedSerializedWriter &writer) const { writer.write(_max); writeArray(writer, _sequences); writer.write(_patternFollow); - writer.write(_useMultiCv); } void CurveTrack::read(VersionedSerializedReader &reader) { @@ -83,5 +81,4 @@ void CurveTrack::read(VersionedSerializedReader &reader) { reader.read(_max, ProjectVersion::Version37); readArray(reader, _sequences); reader.read(_patternFollow, ProjectVersion::Version39); - reader.read(_useMultiCv, ProjectVersion::Version39); } diff --git a/src/apps/sequencer/model/CurveTrack.h b/src/apps/sequencer/model/CurveTrack.h index 47beb84e..1fa89ebb 100644 --- a/src/apps/sequencer/model/CurveTrack.h +++ b/src/apps/sequencer/model/CurveTrack.h @@ -214,22 +214,6 @@ class CurveTrack : public BaseTrack, public BaseTrackPatternFollow { str(Types::curveCvInput(_curveCvInput)); } - // use multi cv recording - bool useMultiCvRec() const { return _useMultiCv;} - - void editUseMultiCvRec(int value) { - _useMultiCv = value == 1; - } - - void printUseMultiCvRec(StringBuilder &str) const { - if (_useMultiCv) str("On"); - else str("Off"); - } - - void setUseMultiCvRec(bool enabled) { - _useMultiCv = enabled; - } - // min float min() const { return _min.get(isRouted(Routing::Target::CurveMin)); } @@ -321,7 +305,6 @@ class CurveTrack : public BaseTrack, public BaseTrackPatternFollow { Routable _max; Types::CurveCvInput _curveCvInput; - bool _useMultiCv; CurveSequenceArray _sequences; diff --git a/src/apps/sequencer/model/Project.cpp b/src/apps/sequencer/model/Project.cpp index 326196fe..4b1fee90 100644 --- a/src/apps/sequencer/model/Project.cpp +++ b/src/apps/sequencer/model/Project.cpp @@ -43,6 +43,7 @@ void Project::clear() { setCvGateInput(Types::CvGateInput::Off); setCurveCvInput(Types::CurveCvInput::Off); setResetCvOnStop(true); + setUseMultiCvRec(true); _clockSetup.clear(); @@ -135,6 +136,7 @@ void Project::write(VersionedSerializedWriter &writer) const { writer.write(_selectedTrackIndex); writer.write(_selectedPatternIndex); writer.write(_resetCvOnStop); + writer.write(_useMultiCv); writer.writeHash(); @@ -190,6 +192,7 @@ bool Project::read(VersionedSerializedReader &reader) { reader.read(_selectedTrackIndex); reader.read(_selectedPatternIndex); reader.read(_resetCvOnStop, ProjectVersion::Version38); + reader.read(_useMultiCv, ProjectVersion::Version39); bool success = reader.checkHash(); if (success) { diff --git a/src/apps/sequencer/model/Project.h b/src/apps/sequencer/model/Project.h index 71464da6..e702f2a2 100644 --- a/src/apps/sequencer/model/Project.h +++ b/src/apps/sequencer/model/Project.h @@ -471,6 +471,23 @@ class Project { _resetCvOnStop = enabled; } + // use multi cv recording + + bool useMultiCvRec() const { return _useMultiCv;} + + void editUseMultiCvRec(int value) { + _useMultiCv = value == 1; + } + + void printUseMultiCvRec(StringBuilder &str) const { + if (_useMultiCv) str("On"); + else str("Off"); + } + + void setUseMultiCvRec(bool enabled) { + _useMultiCv = enabled; + } + // selectedTrackIndex int selectedTrackIndex() const { return _selectedTrackIndex; } @@ -693,6 +710,7 @@ class Project { uint8_t _recordDelay; bool _resetCvOnStop; + bool _useMultiCv; int _selectedTrackIndex = 0; int _selectedPatternIndex = 0; diff --git a/src/apps/sequencer/ui/model/CurveTrackListModel.h b/src/apps/sequencer/ui/model/CurveTrackListModel.h index ad55f23d..34ed78c7 100644 --- a/src/apps/sequencer/ui/model/CurveTrackListModel.h +++ b/src/apps/sequencer/ui/model/CurveTrackListModel.h @@ -64,7 +64,6 @@ class CurveTrackListModel : public RoutableListModel { GateProbabilityBias, PatternFollow, CurveCvInput, - MultiCvRec, Min, Max, Last @@ -82,7 +81,6 @@ class CurveTrackListModel : public RoutableListModel { case ShapeProbabilityBias: return "Shape P. Bias"; case GateProbabilityBias: return "Gate P. Bias"; case PatternFollow: return "Pattern Follow"; - case MultiCvRec: return "Multi Cv Rec"; case CurveCvInput: return "Curve CV Input"; case Min: return "Min"; case Max: return "Max"; @@ -127,9 +125,6 @@ class CurveTrackListModel : public RoutableListModel { case PatternFollow: _track->printPatternFollow(str); break; - case MultiCvRec: - _track->printUseMultiCvRec(str); - break; case CurveCvInput: _track->printCurveCvInput(str); break; @@ -175,9 +170,6 @@ class CurveTrackListModel : public RoutableListModel { case PatternFollow: _track->editPatternFollow(value, shift); break; - case MultiCvRec: - _track->editUseMultiCvRec(value); - break; case CurveCvInput: _track->editCurveCvInput(value, shift); break; diff --git a/src/apps/sequencer/ui/model/ProjectListModel.h b/src/apps/sequencer/ui/model/ProjectListModel.h index 3304925f..31f30679 100644 --- a/src/apps/sequencer/ui/model/ProjectListModel.h +++ b/src/apps/sequencer/ui/model/ProjectListModel.h @@ -82,6 +82,7 @@ class ProjectListModel : public RoutableListModel { StepsToStop, RecordDelay, ResetCvOnStop, + MultiCvRec, //CurveCvInput, Last }; @@ -104,6 +105,7 @@ class ProjectListModel : public RoutableListModel { case StepsToStop: return "Steps to stop"; case RecordDelay: return "Record Delay"; case ResetCvOnStop: return "Reset CV"; + case MultiCvRec: return "Multi CV rec"; //case CurveCvInput: return "Curve CV Input"; case Last: break; } @@ -166,6 +168,9 @@ class ProjectListModel : public RoutableListModel { case ResetCvOnStop: _project.printResetCvOnStop(str); break; + case MultiCvRec: + _project.printUseMultiCvRec(str); + break; //case CurveCvInput: // _project.printCurveCvInput(str); // break; @@ -223,6 +228,9 @@ class ProjectListModel : public RoutableListModel { case ResetCvOnStop: _project.editResetCvOnStop(value); break; + case MultiCvRec: + _project.editUseMultiCvRec(value); + break; //case CurveCvInput: // _project.editCurveCvInput(value, shift); // break; From 6da17ab403ff5f07874f3359aa8ccf832e37a432 Mon Sep 17 00:00:00 2001 From: mebitek Date: Tue, 28 May 2024 14:08:07 +0200 Subject: [PATCH 6/9] issue #118: Stack overflow error with infinet reboot --- src/apps/sequencer/Config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apps/sequencer/Config.h b/src/apps/sequencer/Config.h index 381818db..c8c66b9f 100644 --- a/src/apps/sequencer/Config.h +++ b/src/apps/sequencer/Config.h @@ -22,7 +22,7 @@ #define CONFIG_ENGINE_TASK_STACK_SIZE 4096 #define CONFIG_USBH_TASK_STACK_SIZE 2048 #define CONFIG_UI_TASK_STACK_SIZE 4096 -#define CONFIG_FILE_TASK_STACK_SIZE 2048 +#define CONFIG_FILE_TASK_STACK_SIZE 4096 #define CONFIG_PROFILER_TASK_STACK_SIZE 2048 // Settings flash storage From a8deeb8bf7697edcb225ee085bfaa163c37740a1 Mon Sep 17 00:00:00 2001 From: mebitek Date: Wed, 29 May 2024 05:59:37 +0200 Subject: [PATCH 7/9] fix stochastic note probability evaluation --- src/apps/sequencer/engine/StochasticEngine.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/apps/sequencer/engine/StochasticEngine.cpp b/src/apps/sequencer/engine/StochasticEngine.cpp index 4e5fa1a1..93b4f9ad 100644 --- a/src/apps/sequencer/engine/StochasticEngine.cpp +++ b/src/apps/sequencer/engine/StochasticEngine.cpp @@ -435,7 +435,11 @@ void StochasticEngine::triggerStep(uint32_t tick, uint32_t divisor, bool forNext int sum =0; for (int i = 0; i < 12; i++) { if (sequence.step(i).gate()) { - probability.insert(probability.end(), StochasticStep(i, clamp(sequence.step(i).noteVariationProbability() + _stochasticTrack.noteProbabilityBias(), -1, StochasticSequence::NoteVariationProbability::Max))); + int prob = sequence.step(i).noteVariationProbability() + _stochasticTrack.noteProbabilityBias(); + if (sequence.step(i).noteVariationProbability()==0) { + prob = 0; + } + probability.insert(probability.end(), StochasticStep(i, clamp(prob, -1, StochasticSequence::NoteVariationProbability::Max))); } else { probability.insert(probability.end(), StochasticStep(i, 0)); } From b35c17b5bea294f55e446e276d58f000b36910ab Mon Sep 17 00:00:00 2001 From: mebitek Date: Wed, 29 May 2024 06:07:27 +0200 Subject: [PATCH 8/9] fix arp copy pattern --- src/apps/sequencer/model/ClipBoard.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/apps/sequencer/model/ClipBoard.cpp b/src/apps/sequencer/model/ClipBoard.cpp index 38ce2b36..5e78ef9a 100644 --- a/src/apps/sequencer/model/ClipBoard.cpp +++ b/src/apps/sequencer/model/ClipBoard.cpp @@ -109,6 +109,9 @@ void ClipBoard::copyPattern(int patternIndex) { case Track::TrackMode::Logic: pattern.sequences[trackIndex].data.logic = track.logicTrack().sequence(patternIndex); break; + case Track::TrackMode::Arp: + pattern.sequences[trackIndex].data.arp = track.arpTrack().sequence(patternIndex); + break; default: break; } From 5d3441e625211a49238bb9c2f68bc2abb1cd5f2b Mon Sep 17 00:00:00 2001 From: mebitek Date: Wed, 29 May 2024 10:51:52 +0200 Subject: [PATCH 9/9] update changelog --- CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2dd4a5c6..b440f23d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,16 @@ # Changelog -# v0.3.1 () +# v0.3.1 (29 May 2024) - issue #111 - fix program change - issue #112 - fix launchpad follow mode +- issue #115 - follow pattern is now saved on project +- issue #116 - fix F1-F5 shortcut +- issue #117 - fix curve cv problem +- issue #118 - fix file stack overflow - fix fill display +- fix stochastic reseed behaviour +- fix arp track copy pattern + # v0.3.0 (02 May 2024) - Arpeggiator Track