private bool CheckIfCustomPitchSet() { RestMusicXML restElement = noteItem.Items.OfType <RestMusicXML>().FirstOrDefault(); if (restElement?.DisplayOctave != null) { customStep = restElement.DisplayStep; customOctave = restElement.DisplayOctave; return(true); } return(false); }
public NoteBuilder SetPitch(StepMusicXML step, int octave) { if (octave < 0 || octave > 9) { throw new Exception("NoteBuilder::SetPitch() -Octave Pitch have to be in between 0 and 9"); } var pitch = new PitchMusicXML { Step = step, Octave = octave.ToString() }; AppendItem(NoteChoiceTypeMusicXML.pitch, pitch); return(this); }