internal void ShiftNoteheadPitch(OctaveShiftType octaveShiftType) { GetComponents(NoteheadPitch, out string soundingPitchString, out int octave); switch (octaveShiftType) { case OctaveShiftType.up3Oct: octave += 3; break; case OctaveShiftType.up2Oct: octave += 2; break; case OctaveShiftType.up1Oct: octave += 1; break; case OctaveShiftType.down1Oct: octave -= 1; break; case OctaveShiftType.down2Oct: octave -= 2; break; case OctaveShiftType.down3Oct: octave -= 3; break; } M.Assert(octave > -1 && octave < 10); NoteheadPitch = soundingPitchString + octave.ToString(); }
public void ShiftNoteheadPitches(OctaveShiftType octaveShiftType) { foreach (var note in Notes) { note.ShiftNoteheadPitch(octaveShiftType); } }
private OctaveShiftType GetOctaveShiftType(string value) { OctaveShiftType rval = OctaveShiftType.up1Oct; switch (value) { case "-8": rval = OctaveShiftType.down1Oct; break; case "8": rval = OctaveShiftType.up1Oct; break; case "-15": rval = OctaveShiftType.down2Oct; break; case "15": rval = OctaveShiftType.up2Oct; break; case "-22": rval = OctaveShiftType.down3Oct; break; case "22": rval = OctaveShiftType.up3Oct; break; default: M.ThrowError("Error: unknown octave shift type"); break; } return(rval); }