Deluge Firmware 1.3.0
Build date: 2025.04.16
Loading...
Searching...
No Matches
ScaleMapper Class Reference
Collaboration diagram for ScaleMapper:

Public Member Functions

bool computeChangeFrom (NoteSet notes, NoteSet sourceScale, NoteSet targetScale, ScaleChange &changes)
 

Private Member Functions

NoteSet initialTransitionScale (NoteSet sourceScale)
 
void computeInitialChanges (NoteSet sourceScale, NoteSet initialScale, ScaleChange &changes)
 
void flushTransitionScaleStore (NoteSet initialScale)
 
void computeFinalChanges (NoteSet initialScale, NoteSet transitionScale, NoteSet targetScale, ScaleChange &changes)
 
NoteSet nextTransitionScale (NoteSet notes, NoteSet transitionScale, NoteSet targetScale)
 

Private Attributes

NoteSet lastTransitionNotes
 
NoteSet transitionScaleStore [kMaxScaleSize]
 

Member Function Documentation

◆ computeChangeFrom()

bool ScaleMapper::computeChangeFrom ( NoteSet notes,
NoteSet sourceScale,
NoteSet targetScale,
ScaleChange & changes )

With notes being currently in use, compute ScaleChange to go from sourceScale to targetScale.

In production code freezes with error if the scale change cannot be computed, for testing purposes returns false.

The computed ScaleChanges are such that as long as no new notes are added, all transitions are reversible.

Member Data Documentation

◆ lastTransitionNotes

NoteSet ScaleMapper::lastTransitionNotes
private

Stores the transition notes from the last computed scale change.

◆ transitionScaleStore

NoteSet ScaleMapper::transitionScaleStore[kMaxScaleSize]
private

Indexes 0-11 store the transition scales for the corresponding scale size - 1.

Note: we include 12 tone scales both for simplicity, and in order to support 12-tone scales with bent notes.


The documentation for this class was generated from the following files: