Deluge Firmware 1.3.0
Build date: 2026.07.29
Loading...
Searching...
No Matches
song.h
1/*
2 * Copyright © 2014-2023 Synthstrom Audible Limited
3 *
4 * This file is part of The Synthstrom Audible Deluge Firmware.
5 *
6 * The Synthstrom Audible Deluge Firmware is free software: you can redistribute it and/or modify it under the
7 * terms of the GNU General Public License as published by the Free Software Foundation,
8 * either version 3 of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
11 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 * See the GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along with this program.
15 * If not, see <https://www.gnu.org/licenses/>.
16 */
17
18#pragma once
19
20#include "definitions_cxx.hpp"
21#include "gui/menu_item/reverb/model.h"
22#include "io/midi/learned_midi.h"
23#include "model/clip/clip.h"
24#include "model/clip/clip_array.h"
25#include "model/global_effectable/global_effectable_for_song.h"
26#include "model/instrument/instrument.h"
27#include "model/output.h"
28#include "model/scale/musical_key.h"
29#include "model/scale/note_set.h"
30#include "model/scale/preset_scales.h"
31#include "model/scale/scale_change.h"
32#include "model/scale/scale_mapper.h"
33#include "model/sync.h"
34#include "model/timeline_counter.h"
35#include "modulation/params/param.h"
36#include "modulation/params/param_manager.h"
37#include "storage/flash_storage.h"
38#include "util/container/array/ordered_resizeable_array_with_multi_word_key.h"
39#include "util/d_string.h"
40
41class MidiCommand;
42class Clip;
43class AudioClip;
44class Instrument;
45class InstrumentClip;
46class Synth;
48class Instrument;
50class Drum;
51class SoundInstrument;
52class SoundDrum;
53class Action;
54class ArrangementRow;
57class Kit;
58class MIDIInstrument;
59class NoteRow;
60class Output;
61class AudioOutput;
62class ModelStack;
64Clip* getCurrentClip();
65InstrumentClip* getCurrentInstrumentClip();
66AudioClip* getCurrentAudioClip();
67Output* getCurrentOutput();
68Kit* getCurrentKit();
69Instrument* getCurrentInstrument();
70OutputType getCurrentOutputType();
71
72class Section {
73public:
74 LearnedMIDI launchMIDICommand;
75 int16_t numRepetitions;
76
77 Section() { numRepetitions = 0; }
78};
79
81 ModControllableAudio* modControllable;
82 Clip* clip;
83 ParamManager paramManager;
84};
85
86#define MAX_NOTES_CHORD_MEM 10
87
88enum SessionMacroKind : int8_t {
89 NO_MACRO = 0,
90 CLIP_LAUNCH,
91 OUTPUT_CYCLE,
92 SECTION,
93 NUM_KINDS,
94};
95
97 SessionMacroKind kind{NO_MACRO};
98 Clip* clip{nullptr};
99 Output* output{nullptr};
100 uint8_t section{0};
101};
102
103class Song final : public TimelineCounter {
104public:
105 Song();
106 ~Song() override;
107 bool mayDoubleTempo();
108 bool ensureAtLeastOneSessionClip();
109 void transposeAllScaleModeClips(int32_t interval);
110 void transposeAllScaleModeClips(int32_t offset, bool chromatic);
111 bool anyScaleModeClips();
112 void changeMusicalMode(uint8_t yVisualWithinOctave, int8_t change);
113 void rotateMusicalMode(int8_t change);
114 void replaceMusicalMode(const ScaleChange& changes, bool affectMIDITranspose);
115 int32_t getYVisualFromYNote(int32_t yNote, bool inKeyMode);
116 int32_t getYVisualFromYNote(int32_t yNote, bool inKeyMode, const MusicalKey& key);
117 int32_t incrementYNoteInKey(int32_t yNote, int32_t increment, bool inOctave, bool inKey) const;
118 static int32_t incrementYNoteInKey(int32_t yNote, int32_t increment, bool inOctave, const MusicalKey& key);
119 static int32_t incrementYNoteNoKey(int32_t yNote, int32_t increment, bool inOctave, const MusicalKey& key);
120 int32_t getYNoteFromYVisual(int32_t yVisual, bool inKeyMode);
121 int32_t getYNoteFromYVisual(int32_t yVisual, bool inKeyMode, const MusicalKey& key);
122 bool mayMoveModeNote(int16_t yVisualWithinOctave, int8_t newOffset);
123 ParamManagerForTimeline* findParamManagerForDrum(Kit* kit, Drum* drum, Clip* stopTraversalAtClip = nullptr);
124 void setupPatchingForAllParamManagersForDrum(SoundDrum* drum);
125 void setupPatchingForAllParamManagersForInstrument(SoundInstrument* sound);
126 void grabVelocityToLevelFromMIDICableAndSetupPatchingForAllParamManagersForInstrument(MIDICable& cable,
127 SoundInstrument* instrument);
128 void grabVelocityToLevelFromMIDICableAndSetupPatchingForAllParamManagersForDrum(MIDICable& cable, SoundDrum* drum,
129 Kit* kit);
130 void grabVelocityToLevelFromMIDICableAndSetupPatchingForEverything(MIDICable& cable);
131 void getCurrentRootNoteAndScaleName(StringBuf& buffer);
132 void displayCurrentRootNoteAndScaleName();
133
134 // Scale-related methods
135
137 Scale cycleThroughScales();
139 Scale getCurrentScale();
142 Scale setScale(Scale newScale);
145 bool setScaleNotes(NoteSet newScale);
149 bool hasUserScale();
152 void setRootNote(int32_t newRootNote, InstrumentClip* clipToAvoidAdjustingScrollFor = nullptr);
155
156 void setTempoFromNumSamples(double newTempoSamples, bool shouldLogAction);
157 void setupDefault();
158 void setBPM(float tempoBPM, bool shouldLogAction);
159 void setTempoFromParams(int32_t magnitude, int8_t whichValue, bool shouldLogAction);
160 void deleteSoundsWhichWontSound();
161 void writeTemplateSong(const char* templateSong);
162 void
163 deleteClipObject(Clip* clip, bool songBeingDestroyedToo = false,
164 InstrumentRemoval instrumentRemovalInstruction = InstrumentRemoval::DELETE_OR_HIBERNATE_IF_UNUSED);
165 int32_t getMaxMIDIChannelSuffix(int32_t channel);
166 void addOutput(Output* output, bool atStart = true);
167 void deleteOutputThatIsInMainList(Output* output, bool stopAnyAuditioningFirst = true);
168 void markAllInstrumentsAsEdited();
169 Instrument* getInstrumentFromPresetSlot(OutputType outputType, int32_t presetNumber, int32_t presetSubSlotNumber,
170 char const* name, char const* dirPath, bool searchHibernatingToo = true,
171 bool searchNonHibernating = true);
172 AudioOutput* getAudioOutputFromName(std::string_view name);
173 void setupPatchingForAllParamManagers();
174 void replaceInstrument(Instrument* oldInstrument, Instrument* newInstrument, bool keepNoteRowsWithMIDIInput = true);
175 void stopAllMIDIAndGateNotesPlaying();
176 void stopAllAuditioning();
177 void deleteOrHibernateOutput(Output* output);
178 Instrument* getNonAudioInstrumentToSwitchTo(OutputType newOutputType, Availability availabilityRequirement,
179 int16_t newSlot, int8_t newSubSlot, bool* instrumentWasAlreadyInSong);
180 void removeSessionClipLowLevel(Clip* clip, int32_t clipIndex);
181 void changeSwingInterval(int32_t newValue);
182 int32_t convertSyncLevelFromFileValueToInternalValue(int32_t fileValue);
183 int32_t convertSyncLevelFromInternalValueToFileValue(int32_t internalValue);
184 String getSongFullPath();
185 void setSongFullPath(const char* fullPath);
186 int32_t getInputTickMagnitude() const { return insideWorldTickMagnitude + insideWorldTickMagnitudeOffsetFromBPM; }
187
188 GlobalEffectableForSong globalEffectable;
189
190 ClipArray sessionClips;
191 ClipArray arrangementOnlyClips;
192
193 Output* firstOutput;
195 firstHibernatingInstrument; // All Instruments have inValidState set to false when they're added to this list
196
197 OrderedResizeableArrayWithMultiWordKey backedUpParamManagers;
198
199 uint32_t xZoom[2]; // Set default zoom at max zoom-out;
200 int32_t xScroll[2]; // Leave this as signed
201 int32_t xScrollForReturnToSongView;
202 int32_t xZoomForReturnToSongView;
203 bool tripletsOn;
204 uint32_t tripletsLevel; // The number of ticks in one of the three triplets
205
206 uint64_t timePerTimerTickBig;
207 int32_t divideByTimePerTimerTick;
208
209 // How many orders of magnitude faster internal ticks are going than input ticks. Used in combination with
210 // inputTickScale, which is usually 1, but is different if there's an inputTickScaleClip. So, e.g. if
211 // insideWorldTickMagnitude is 1, this means the inside world is spinning twice as fast as the external world, so
212 // MIDI sync coming in representing an 8th-note would be interpreted internally as a quarter-note (because two
213 // internal 8th-notes would have happened, twice as fast, making a quarter-note)
214 int32_t insideWorldTickMagnitude;
215
216 // Sometimes, we'll do weird stuff to insideWorldTickMagnitude for sync-scaling, which would make BPM values look
217 // weird. So, we keep insideWorldTickMagnitudeOffsetFromBPM
218 int32_t insideWorldTickMagnitudeOffsetFromBPM;
219
220 int8_t swingAmount;
221 uint8_t swingInterval;
222
223 Section sections[kMaxNumSections];
224
225 MusicalKey key;
226 std::bitset<NUM_PRESET_SCALES> disabledPresetScales;
227
228 String name;
229
230 bool affectEntire;
231
232 SessionLayoutType sessionLayout = FlashStorage::defaultSessionLayout;
233 int32_t songGridScrollX = 0;
234 int32_t songGridScrollY = 0;
235 int32_t songViewYScroll;
236 int32_t arrangementYScroll;
237
238 uint8_t sectionToReturnToAfterSongEnd;
239
240 bool wasLastInArrangementEditor;
241 int32_t lastClipInstanceEnteredStartPos; // -1 means we are not "inside" an arrangement. While we're in the
242 // ArrangementEditor, it's 0
243
244 bool arrangerAutoScrollModeActive;
245
246 MIDIInstrument* hibernatingMIDIInstrument;
247
248 bool outputClipInstanceListIsCurrentlyInvalid; // Set to true during scenarios like replaceInstrument(), to warn
249 // other functions not to look at Output::clipInstances
250
251 bool paramsInAutomationMode;
252
253 bool inClipMinderViewOnLoad; // Temp variable only valid while loading Song
254
255 int32_t unautomatedParamValues[deluge::modulation::params::kMaxNumUnpatchedParams];
256
257 String dirPath;
258
259 std::array<SessionMacro, 8> sessionMacros{};
260
261 bool getAnyClipsSoloing() const;
262 Clip* getCurrentClip();
263 void setCurrentClip(Clip* clip) {
264 if (currentClip != nullptr) {
265 previousClip = currentClip;
266 }
267 currentClip = clip;
268 }
269 uint32_t getInputTickScale();
270 Clip* getSyncScalingClip();
271 void setInputTickScaleClip(Clip* clip);
272 inline bool isFillModeActive() { return fillModeActive; }
273 void changeFillMode(bool on);
274 void loadNextSong();
275 void setClipLength(Clip* clip, uint32_t newLength, Action* action, bool mayReSyncClip = true);
276 void doubleClipLength(InstrumentClip* clip, Action* action = nullptr);
277 Clip* getClipWithOutput(Output* output, bool mustBeActive = false, Clip* excludeClip = nullptr);
278 Error readFromFile(Deserializer& reader);
279 void writeToFile();
280 void loadAllSamples(bool mayActuallyReadFiles = true);
281 void renderAudio(std::span<StereoSample> outputBuffer, int32_t* reverbBuffer, int32_t sideChainHitPending);
282 bool isYNoteAllowed(int32_t yNote, bool inKeyMode);
283 Clip* syncScalingClip;
284 void setTimePerTimerTick(uint64_t newTimeBig, bool shouldLogAction = false);
285 bool hasAnySwing();
286 void resyncLFOs();
287 void ensureInaccessibleParamPresetValuesWithoutKnobsAreZero(Sound* sound);
288 bool areAllClipsInSectionPlaying(int32_t section);
289 void removeYNoteFromMode(int32_t yNoteWithinOctave);
290 void turnSoloingIntoJustPlaying(bool getRidOfArmingToo = true);
291 void reassessWhetherAnyClipsSoloing();
292 float getTimePerTimerTickFloat();
293 uint32_t getTimePerTimerTickRounded();
294 int32_t getNumOutputs();
295 Clip* getNextSessionClipWithOutput(int32_t offset, Output* output, Clip* prevClip);
296 bool anyClipsSoloing;
297
298 ParamManager* getBackedUpParamManagerForExactClip(ModControllableAudio* modControllable, Clip* clip,
299 ParamManager* stealInto = nullptr);
300 ParamManager* getBackedUpParamManagerPreferablyWithClip(ModControllableAudio* modControllable, Clip* clip,
301 ParamManager* stealInto = nullptr);
302 void backUpParamManager(ModControllableAudio* modControllable, Clip* clip, ParamManagerForTimeline* paramManager,
303 bool shouldStealExpressionParamsToo = false);
304 void moveInstrumentToHibernationList(Instrument* instrument);
305 void deleteOrHibernateOutputIfNoClips(Output* output);
306 void removeInstrumentFromHibernationList(Instrument* instrument);
307 bool doesOutputHaveActiveClipInSession(Output* output);
308 bool doesNonAudioSlotHaveActiveClipInSession(OutputType outputType, int32_t slot, int32_t subSlot = -1);
309 bool doesNonAudioSlotHaveClipInSession(OutputType outputType, int32_t slot, int32_t subSlot);
310 bool doesOutputHaveAnyClips(Output* output);
311 void deleteBackedUpParamManagersForClip(Clip* clip);
312 void deleteBackedUpParamManagersForModControllable(ModControllableAudio* modControllable);
313 void deleteHibernatingInstrumentWithSlot(OutputType outputType, char const* name);
314 void loadCrucialSamplesOnly();
315 Clip* getSessionClipWithOutput(Output* output, int32_t requireSection = -1, Clip* excludeClip = nullptr,
316 int32_t* clipIndex = nullptr, bool excludePendingOverdubs = false);
317 void restoreClipStatesBeforeArrangementPlay();
318 void deleteOrAddToHibernationListOutput(Output* output);
319 int32_t getLowestSectionWithNoSessionClipForOutput(Output* output);
320 void assertActiveness(ModelStackWithTimelineCounter* modelStack, int32_t endInstanceAtTime = -1);
321 [[nodiscard]] bool isClipActive(Clip const* clip) const;
322 void sendAllMIDIPGMs();
323 void sortOutWhichClipsAreActiveWithoutSendingPGMs(ModelStack* modelStack, int32_t playbackWillStartInArrangerAtPos);
324 void deactivateAnyArrangementOnlyClips();
325 Clip* getLongestClip(bool includePlayDisabled, bool includeArrangementOnly);
326 Clip* getLongestActiveClipWithMultipleOrFactorLength(int32_t targetLength, bool revertToAnyActiveClipIfNone = true,
327 Clip* excludeClip = nullptr);
328 int32_t getOutputIndex(Output* output);
329 void setHibernatingMIDIInstrument(MIDIInstrument* newInstrument);
330 void deleteHibernatingMIDIInstrument();
331 MIDIInstrument* grabHibernatingMIDIInstrument(int32_t newSlot, int32_t newSubSlot);
332 NoteRow* findNoteRowForDrum(Kit* kit, Drum* drum, Clip* stopTraversalAtClip = nullptr);
333
334 bool anyOutputsSoloingInArrangement;
335 bool getAnyOutputsSoloingInArrangement();
336 void reassessWhetherAnyOutputsSoloingInArrangement();
337 bool isOutputActiveInArrangement(Output* output);
338 Output* getOutputFromIndex(int32_t index);
339 void ensureAllInstrumentsHaveAClipOrBackedUpParamManager(char const* errorMessageNormal,
340 char const* errorMessageHibernating);
341 Error placeFirstInstancesOfActiveClips(int32_t pos);
342 void endInstancesOfActiveClips(int32_t pos, bool detachClipsToo = false);
343 void clearArrangementBeyondPos(int32_t pos, Action* action);
344 void deletingClipInstanceForClip(Output* output, Clip* clip, Action* action, bool shouldPickNewActiveClip);
345 bool arrangementHasAnyClipInstances();
346 void resumeClipsClonedForArrangementRecording();
347 void setParamsInAutomationMode(bool newState);
348 bool shouldOldOutputBeReplaced(Clip* clip, Availability* availabilityRequirement = nullptr);
349 Output* navigateThroughPresetsForInstrument(Output* output, int32_t offset);
350 void instrumentSwapped(Instrument* newInstrument);
351 Instrument* changeOutputType(Instrument* oldInstrument, OutputType newOutputType);
352 AudioOutput* getFirstAudioOutput();
353 AudioOutput* createNewAudioOutput(Output* replaceOutput = nullptr);
355 void getNoteLengthName(StringBuf& buffer, uint32_t noteLength, char const* notesString = "-notes",
356 bool clarifyPerColumn = false) const;
357 void replaceOutputLowLevel(Output* newOutput, Output* oldOutput);
358 void removeSessionClip(Clip* clip, int32_t clipIndex, bool forceClipsAboveToMoveVertically = false);
359 bool deletePendingOverdubs(Output* onlyWithOutput = nullptr, int32_t* originalClipIndex = nullptr,
360 bool createConsequencesForOtherLinearlyRecordingClips = false);
361 Clip* getPendingOverdubWithOutput(Output* output);
362 Clip* getClipWithOutputAboutToBeginLinearRecording(Output* output);
363 Clip* createPendingNextOverdubBelowClip(Clip* clip, int32_t clipIndex, OverDubType newOverdubNature);
364 bool hasAnyPendingNextOverdubs();
365 Output* getNextAudioOutput(int32_t offset, Output* oldOutput, Availability availabilityRequirement);
366 void deleteOutput(Output* output);
367 void clearRecordingFromReferencesTo(Output* output);
368 void cullAudioClipVoice();
369 int32_t getYScrollSongViewWithoutPendingOverdubs();
370 int32_t removeOutputFromMainList(Output* output, bool stopAnyAuditioningFirst = true);
371 void swapClips(Clip* newClip, Clip* oldClip, int32_t clipIndex);
372 Clip* replaceInstrumentClipWithAudioClip(Clip* oldClip, int32_t clipIndex);
373 void setDefaultVelocityForAllInstruments(uint8_t newDefaultVelocity);
374 void midiCableBendRangeUpdatedViaMessage(ModelStack* modelStack, MIDICable& cable, int32_t channelOrZone,
375 int32_t whichBendRange, int32_t bendSemitones);
376 Error addInstrumentsToFileItems(OutputType outputType);
377
378 uint32_t getQuarterNoteLength();
379 uint32_t getBarLength();
380 uint32_t getSixteenthNoteLength();
381 ModelStackWithThreeMainThings* setupModelStackWithSongAsTimelineCounter(void* memory);
382 ModelStackWithTimelineCounter* setupModelStackWithCurrentClip(void* memory);
383 ModelStackWithThreeMainThings* addToModelStack(ModelStack* modelStack);
386 ModelStackWithAutoParam* getModelStackWithParam(ModelStackWithThreeMainThings* modelStack, int32_t paramID);
387
388 // TimelineCounter implementation
389 [[nodiscard]] int32_t getLastProcessedPos() const override;
390 [[nodiscard]] uint32_t getLivePos() const override;
391 [[nodiscard]] int32_t getLoopLength() const override;
392 [[nodiscard]] bool isPlayingAutomationNow() const override;
393 [[nodiscard]] bool backtrackingCouldLoopBackToEnd() const override;
394 [[nodiscard]] int32_t getPosAtWhichPlaybackWillCut(ModelStackWithTimelineCounter const* modelStack) const override;
395 void getActiveModControllable(ModelStackWithTimelineCounter* modelStack) override;
396 void expectEvent() override;
397 TimelineCounter* getTimelineCounterToRecordTo() override;
398
399 // Reverb params to be stored here between loading and song being made the active one
400 dsp::Reverb::Model model;
401 float reverbRoomSize;
402 float reverbHPF;
403 float reverbLPF;
404 float reverbDamp;
405 float reverbWidth;
406 int32_t reverbPan;
407 int32_t reverbSidechainVolume;
408 int32_t reverbSidechainShape;
409 int32_t reverbSidechainAttack;
410 int32_t reverbSidechainRelease;
411 SyncLevel reverbSidechainSync;
412
413 // START ~ new Automation Arranger View Variables
414 int32_t lastSelectedParamID; // last selected Parameter to be edited in Automation Arranger View
416 lastSelectedParamKind; // 0 = patched, 1 = unpatched, 2 = global effectable, 3 = none
417 int32_t lastSelectedParamShortcutX;
418 int32_t lastSelectedParamShortcutY;
419 int32_t lastSelectedParamArrayPosition;
420 // END ~ new Automation Arranger View Variables
421
422 // Song level transpose control (encoder actions)
423 void commandTranspose(int32_t interval);
424 int32_t masterTransposeInterval = 0;
425 void transpose(int32_t interval);
426 void adjustMasterTransposeInterval(int32_t interval);
427 void displayMasterTransposeInterval();
428
429 // MIDI controlled song transpose
430 bool hasBeenTransposed = 0;
431 int16_t transposeOffset = 0;
432
433 int32_t countAudioClips() const;
434
435 // Chord memory
436 uint8_t chordMemNoteCount[kDisplayHeight] = {0};
437 uint8_t chordMem[kDisplayHeight][MAX_NOTES_CHORD_MEM] = {0};
438
439 // Tempo automation
440 void clearTempoAutomation();
441 void updateBPMFromAutomation();
442
443 float calculateBPM() {
444 float timePerTimerTick = getTimePerTimerTickFloat();
445 return calculateBPM(timePerTimerTick);
446 }
447 float calculateBPM(float timePerTimerTick) {
448
449 if (insideWorldTickMagnitude > 0) {
450 timePerTimerTick *= ((uint32_t)1 << (insideWorldTickMagnitude));
451 }
452 float tempoBPM = (float)110250 / timePerTimerTick;
453 if (insideWorldTickMagnitude < 0) {
454 tempoBPM *= ((uint32_t)1 << (-insideWorldTickMagnitude));
455 }
456 return tempoBPM;
457 }
458
459 int8_t defaultAudioClipOverdubOutputCloning = -1; // -1 means no default set
460
461 // Threshold
462 void changeThresholdRecordingMode(int8_t offset);
463 void displayThresholdRecordingMode();
464 ThresholdRecordingMode thresholdRecordingMode;
465
466private:
467 ScaleMapper scaleMapper;
468 NoteSet userScaleNotes;
469 bool fillModeActive;
470 Clip* currentClip = nullptr;
471 Clip* previousClip = nullptr; // for future use, maybe finding an instrument clip or something
472 void inputTickScalePotentiallyJustChanged(uint32_t oldScale);
473 Error readClipsFromFile(Deserializer& reader, ClipArray* clipArray);
474 void addInstrumentToHibernationList(Instrument* instrument);
475 void deleteAllBackedUpParamManagers(bool shouldAlsoEmptyVector = true);
476 void deleteAllBackedUpParamManagersWithClips();
477 void deleteAllOutputs(Output** prevPointer);
478 void setupClipIndexesForSaving();
479 void setBPMInner(float tempoBPM, bool shouldLogAction);
480 void clearTempoAutomation(float tempoBPM);
481 int32_t intBPM{0};
482};
483
484extern Song* currentSong;
485extern Song* preLoadedSong;
Definition action.h:79
Definition arpeggiator.h:48
Definition audio_clip.h:35
Definition audio_output.h:37
Definition clip_array.h:25
Definition clip.h:46
Definition drum.h:44
Definition global_effectable_for_song.h:22
Definition instrument_clip.h:48
Definition instrument.h:45
Definition kit.h:34
Definition learned_midi.h:30
A MIDI cable connection. Stores all state specific to a given cable and its contained ports and chann...
Definition midi_device.h:96
Definition midi_instrument.h:37
Definition mod_controllable_audio.h:47
Definition model_stack.h:129
Definition model_stack.h:123
Definition musical_key.h:10
Definition note_row.h:99
Definition note_set.h:20
Definition ordered_resizeable_array_with_multi_word_key.h:25
Definition output.h:81
Definition param_manager.h:174
Definition param_manager.h:45
Definition scale_change.h:5
Definition song.h:72
Definition song.h:103
Scale getCurrentScale()
Returns current scale.
Definition song.cpp:3070
Scale setScale(Scale newScale)
Returns CUSTOM_SCALE_WITH_MORE_THAN_7_NOTES we can't use the newScale.
Definition song.cpp:3022
void learnScaleFromCurrentNotes()
Learns a user scale from notes in scale mode clips.
ModelStackWithAutoParam * getModelStackWithParam(ModelStackWithThreeMainThings *modelStack, int32_t paramID)
Definition song.cpp:6008
void setRootNote(int32_t newRootNote, InstrumentClip *clipToAvoidAdjustingScrollFor=nullptr)
Definition song.cpp:582
bool hasUserScale()
Returns true if the song has a user scale.
Definition song.cpp:3066
void getNoteLengthName(StringBuf &buffer, uint32_t noteLength, char const *notesString="-notes", bool clarifyPerColumn=false) const
buffer must have at least 5 characters on 7seg, or 30 for OLED
Definition song.cpp:5258
NoteSet notesInScaleModeClips()
Returns a NoteSet with all notes currently in used in scale mdoe clips.
Definition song.cpp:572
int32_t getLastProcessedPos() const override
Get the tick at which this timeline counter last did anything.
Definition song.cpp:5768
bool setScaleNotes(NoteSet newScale)
Definition song.cpp:3035
uint32_t getLivePos() const override
Get the current tick of this timeline counter relative to the playback handler.
Definition song.cpp:5756
Scale cycleThroughScales()
Changes to next applicable scale.
Definition song.cpp:3006
Definition sound_drum.h:28
Definition sound_instrument.h:30
Definition d_stringbuf.h:16
Definition d_string.h:41
Kind
Definition param.h:42
Definition song.h:80
Definition song.h:96