MCPcopy Create free account
hub / github.com/DamRsn/NeuralNote / _createKeyVector

Method _createKeyVector

Lib/MidiPostProcessing/NoteOptions.cpp:95–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95std::vector<int> NoteOptions::_createKeyVector(RootNote inRootNote, ScaleType inScaleType)
96{
97 auto root_note_idx = _rootNoteToNoteIdx(inRootNote);
98
99 switch (inScaleType) {
100 case Major:
101 return _createKeyVectorForScale(root_note_idx, MAJOR_SCALE_INTERVALS);
102 case Minor:
103 return _createKeyVectorForScale(root_note_idx, MINOR_SCALE_INTERVALS);
104 case Dorian:
105 return _createKeyVectorForScale(root_note_idx, DORIAN_SCALE_INTERVALS);
106 case Mixolydian:
107 return _createKeyVectorForScale(root_note_idx, MIXOLYDIAN_SCALE_INTERVALS);
108 case Lydian:
109 return _createKeyVectorForScale(root_note_idx, LYDIAN_SCALE_INTERVALS);
110 case Phrygian:
111 return _createKeyVectorForScale(root_note_idx, PHRYGIAN_SCALE_INTERVALS);
112 case Locrian:
113 return _createKeyVectorForScale(root_note_idx, LOCRIAN_SCALE_INTERVALS);
114 case MinorBlues:
115 return _createKeyVectorForScale(root_note_idx, MINOR_BLUES_SCALE_INTERVALS);
116 case MinorPentatonic:
117 return _createKeyVectorForScale(root_note_idx, MINOR_PENTATONIC_SCALE_INTERVALS);
118 case MajorPentatonic:
119 return _createKeyVectorForScale(root_note_idx, MAJOR_PENTATONIC_SCALE_INTERVALS);
120 case MelodicMinor:
121 return _createKeyVectorForScale(root_note_idx, MELODIC_MINOR_SCALE_INTERVALS);
122 case HarmonicMinor:
123 return _createKeyVectorForScale(root_note_idx, HARMONIC_MINOR_SCALE_INTERVALS);
124 case HarmonicMajor:
125 return _createKeyVectorForScale(root_note_idx, HARMONIC_MAJOR_SCALE_INTERVALS);
126 default:
127 // If chromatic, vector should not be used.
128 return {};
129 }
130}
131
132int NoteOptions::_rootNoteToNoteIdx(RootNote inRootNote)
133{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected