Beispiel #1
0
        public Note() { } //Here for Xml (De)Serialization

        public Note(string staff, Pitch pitch, NoteType noteType, string voice = "1")
        {
            Items = new object[2]; /*At the very least a Pitch / Rest and duration*/
            ItemsElementName = new ItemsChoiceType1[2];
            Voice = voice;
            Staff = staff;
            Pitch = pitch;
            Duration = 1024; 
            NoteType = noteType;
            Stem = new Stem { Value = StemValue.Up };
            Instrument = new Instrument { Id = "P1-I1" };
        }
Beispiel #2
0
        public static int MidiLookUp(Pitch pitch)
        {

            var skip = pitch.Step;
            var alter = (int)pitch.Alter;
            var octave = Convert.ToInt32(pitch.Octave) + 1;

            if (!NoteColumnLookup.ContainsKey(skip.ToString())) throw new InvalidSkipException(skip);

            return MidiArray[octave][NoteColumnLookup[skip.ToString()]] + alter;
        }