140 int _rootPitchClass = 0;
141 Mode _mode = Chromatic;
Dynamic array container wrapping std::vector.
Definition list.h:40
size_t size() const noexcept
Returns the number of elements in the list.
Definition list.h:301
Represents a musical scale with a root pitch class and mode.
Definition musicalscale.h:26
static const MembershipMask & membershipMaskForMode(Mode mode)
Returns the chromatic membership mask for a mode.
int degreesPerOctave() const
Returns the number of degrees per octave in this scale.
Definition musicalscale.h:72
static std::pair< MusicalScale, Error > fromName(const String &name)
Parses a scale name such as "C Major" or "Eb Blues".
MusicalScale(int rootPitchClass, Mode mode)
Constructs a scale with the given root pitch class and mode.
int rootPitchClass() const
Returns the root pitch class (0–11).
Definition musicalscale.h:66
float midiNoteForDegree(int degree, int octave) const
Returns the MIDI note number for a given scale degree and octave.
bool containsNote(int midiNote) const
Tests whether a MIDI note number belongs to this scale.
static const char * modeName(Mode mode)
Returns the human-readable name for a mode.
Mode
Scale mode.
Definition musicalscale.h:29
std::array< int, 12 > MembershipMask
Chromatic membership mask for a scale.
Definition musicalscale.h:45
Mode mode() const
Returns the scale mode.
Definition musicalscale.h:69
static List< int > intervalsForMode(Mode mode)
Returns the interval list (cumulative semitone offsets) for a mode.
float constrainNote(float midiNote, float strength=1.0f) const
Constrains a fractional MIDI note to the nearest scale tone.
static const char * pitchClassName(int pitchClass)
Returns the human-readable name for a pitch class.
static int pitchClassFromName(const String &name)
Parses a pitch class name ("C", "F#", "Bb") to a pitch class number.
static std::pair< Mode, Error > modeFromName(const String &name)
Parses a mode name to the Mode enum.
MusicalScale()
Default-constructs a C Chromatic scale.
Encoding-aware string class with copy-on-write semantics.
Definition string.h:35
#define PROMEKI_NAMESPACE_BEGIN
Starts a promeki namespace block.
Definition namespace.h:14
#define PROMEKI_NAMESPACE_END
Ends a promeki namespace block.
Definition namespace.h:19