Skip to content

Commit

Permalink
add comment to function
Browse files Browse the repository at this point in the history
  • Loading branch information
Seanitzel committed Jul 17, 2023
1 parent 1fbf6e0 commit 4e4de34
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/utilities/MusicFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,10 @@ export function pitchClassesToPianoChordNotes(pitchClasses: Array<PitchClass>, o
if(inversion) {
pitchClasses = rearrangeArray(pitchClasses, inversion) as Array<PitchClass>;
}
// const notes = pitchClassesToNotes(pitchClasses, octave);
// for(let i=1; i< notes.length; ++i) {
// const prevNote = notes[i-1];
// const normalizedPrevNote = normalizeNote(prevNote);
// const note = notes[i];
// const normalizedNote = normalizeNote(note);
// const { pitchClass, octave } = noteToObject(note);
// const { pitchClass: prevPitchClass, octave: prevOctave } = noteToObject(prevNote);
// const pcIndex = getPitchClassIndex(normalizePitchClass(pitchClass));
// const prevPcIndex = getPitchClassIndex(normalizePitchClass(pitchClasses[i - 1]));
// if(pitchClass[0] === 'C' && prevPitchClass[0] === 'B') {
// notes[i] = `${pitchClass}${octave + 1}` as Note;
// }
// }
// return notes;
let currentOctave = octave;
let wasNextOctave = false;

// The reason this implementation is so complicated is that it can handle any raw pitch classes given to it properly, e.g Cb, Bx, Dbbb, etc.
const notes = pitchClasses.map((pitchClass, i) => {
if(i !== 0) {
const pcIndex = getPitchClassIndex(normalizePitchClass(pitchClass));
Expand Down

0 comments on commit 4e4de34

Please sign in to comment.