Exemplo n.º 1
0
        public Keyboard(int lowOctave, int highOctave)
        {
            List <KeyboardOctave> octaves = new List <KeyboardOctave>();

            KeyMap = new Dictionary <int, MidiKey>();

            for (var i = lowOctave; i < highOctave + 1; i++)
            {
                var oct = new KeyboardOctave(i);

                foreach (var midiKey in oct.Keys)
                {
                    KeyMap.Add(midiKey.NoteNumber, midiKey);
                }

                octaves.Add(oct);
            }

            this.Octaves = octaves.ToArray();
        }
Exemplo n.º 2
0
 internal MidiKey(int noteNumber, Note note, KeyboardOctave octave)
 {
     NoteNumber = noteNumber;
     Note       = note;
     _Octave    = octave;
 }