コード例 #1
0
 /// <param name="trkDef">The target trk</param>
 /// <param name="inputControls">If non-null, this inputControls overrrides the InputControls in the InputNote or InputChord</param>
 public TrkOn(TrkDef trkDef, InputControls inputControls)
 {
     _trkMidiChannel    = trkDef.MidiChannel;
     _trkMsPosition     = trkDef.StartMsPosition;
     _trkNumMidiObjects = trkDef.DurationsCount;             // includes MidiChordDef, RestDef
     _inputControls     = inputControls;
 }
コード例 #2
0
 /// <param name="trkDef">The target trk's midi channel</param>
 /// <param name="trkStartPosition">The target trk's startMsPosition</param>
 /// <param name="trkNumMidiObjects">The number of MidiChordDefs and RestDefs in the target trk.</param>
 /// <param name="inputControls">If non-null, this inputControls overrrides the InputControls in the InputNote or InputChord</param>
 public TrkOn(byte trkMidiChannel, int trkStartPosition, int trkNumMidiObjects, InputControls inputControls)
 {
     _trkMidiChannel    = trkMidiChannel;
     _trkMsPosition     = trkStartPosition;
     _trkNumMidiObjects = trkNumMidiObjects;
     _inputControls     = inputControls;
 }
コード例 #3
0
ファイル: InputNoteDef.cs プロジェクト: suvjunmd/Moritz
        internal void WriteSvg(SvgWriter w)
        {
            w.WriteStartElement("inputNote");
            w.WriteAttributeString("notatedKey", _notatedMidiPitch.ToString());

            if (InputControls != null)
            {
                InputControls.WriteSvg(w);
            }

            if (NoteOnTrkOns != null || NoteOnTrkOffs != null)
            {
                w.WriteStartElement("noteOn");
                WriteNoteOnOff(w, NoteOnTrkOns, NoteOnTrkOffs);
                w.WriteEndElement();                 // noteOn
            }

            if (NotePressures != null)
            {
                NotePressures.WriteSvg(w);
            }

            if (NoteOffTrkOns != null || NoteOffTrkOffs != null)
            {
                w.WriteStartElement("noteOff");
                WriteNoteOnOff(w, NoteOffTrkOns, NoteOffTrkOffs);
                w.WriteEndElement();                 // noteOff
            }

            w.WriteEndElement();             // score:inputNote N.B. This element can be empty!
        }
コード例 #4
0
ファイル: InputNoteDef.cs プロジェクト: suvjunmd/Moritz
        /// <summary>
        ///
        /// </summary>
        /// <param name="notatedMidiPitch">In range 0..127</param>
        /// <param name="noteOnTrkOns">Can be null or empty</param>
        /// <param name="noteOnTrkOffs">Can be null or empty</param>
        /// <param name="pressures">Can be null or empty</param>
        /// <param name="noteOffTrkOns">Can be null or empty</param>
        /// <param name="noteOffTrkOffs">Can be null or empty</param>
        /// <param name="inputControls">Can be null</param>
        public InputNoteDef(byte notatedMidiPitch,
                            TrkOns noteOnTrkOns, TrkOffs noteOnTrkOffs,
                            Pressures pressures,
                            TrkOns noteOffTrkOns, TrkOffs noteOffTrkOffs,
                            InputControls inputControls)
        {
            Debug.Assert(notatedMidiPitch >= 0 && notatedMidiPitch <= 127);
            // If inputControls is null, the higher level inputControls are used.

            NotatedMidiPitch = notatedMidiPitch;
            NoteOnTrkOns     = noteOnTrkOns;
            NoteOnTrkOffs    = noteOnTrkOffs;
            NotePressures    = pressures;
            NoteOffTrkOns    = noteOffTrkOns;
            NoteOffTrkOffs   = noteOffTrkOffs;
            InputControls    = inputControls;
        }
コード例 #5
0
 /// <param name="trkOffs"></param>
 /// <param name="inputControls">Can be null</param>
 public TrkOffs(List <TrkOff> trkOffs, InputControls inputControls)
 {
     Debug.Assert(trkOffs != null && trkOffs.Count > 0);
     _inputControls = inputControls;
     _trkOffs       = trkOffs;
 }
コード例 #6
0
ファイル: Pressure.cs プロジェクト: suvjunmd/Moritz
 /// <param name="midiChannel">The midi channel of the Track to be sent a pressure message</param>
 /// <param name="inputControls">Can be null</param>
 public Pressure(byte midiChannel, InputControls inputControls)
 {
     _midiChannel   = midiChannel;
     _inputControls = inputControls;
 }
コード例 #7
0
ファイル: Pressures.cs プロジェクト: suvjunmd/Moritz
 /// <param name="pressures"></param>
 /// <param name="inputControls">Can be null</param>
 public Pressures(List <Pressure> pressures, InputControls inputControls)
 {
     Debug.Assert(pressures != null && pressures.Count > 0);
     _inputControls = inputControls;
     _pressures     = pressures;
 }
コード例 #8
0
 /// <param name="trkOns"></param>
 /// <param name="inputControls">Can be null</param>
 public TrkOns(List <TrkOn> trkOns, InputControls inputControls)
 {
     Debug.Assert(trkOns != null && trkOns.Count > 0);
     _inputControls = inputControls;
     _trkOns        = trkOns;
 }
コード例 #9
0
ファイル: InputNoteDef.cs プロジェクト: suvjunmd/Moritz
        /// <summary>
        /// This constructs an InputNoteDef that, when the noteOff arrives, turns off all the trks it has turned on.
        /// </summary>
        /// <param name="notatedMidiPitch">In range 0..127</param>
        /// <param name="noteOnSeqDefs">Must contain at least one SeqDef</param>
        /// <param name="pressures">Can be null or empty</param>
        /// <param name="inputControls">Can be null</param>
        public InputNoteDef(byte notatedMidiPitch, TrkOns noteOnSeqDef, Pressures pressures, InputControls inputControls)
            : this(notatedMidiPitch, noteOnSeqDef, null, pressures, null, null, inputControls)
        {
            Debug.Assert(noteOnSeqDef != null);
            List <TrkOff> trkOffs = new List <TrkOff>();

            foreach (TrkOn trkOn in NoteOnTrkOns)
            {
                TrkOff trkOff = new TrkOff(trkOn.TrkMidiChannel, trkOn.TrkMsPosition, inputControls);
                trkOffs.Add(trkOff);
            }
            NoteOffTrkOffs = new TrkOffs(trkOffs, null);
        }
コード例 #10
0
ファイル: TrkOff.cs プロジェクト: suvjunmd/Moritz
 /// <param name="trkMidiChannel">The midi channel of the Trk to be sent a trkOff message</param>
 /// <param name="trkMsPosition">The msPosition (in the score) of the Trk to be sent a trkOff message</param>
 /// <param name="inputControls">Can be null</param>
 public TrkOff(byte trkMidiChannel, int trkMsPosition, InputControls inputControls)
 {
     _midiChannel   = trkMidiChannel;
     _trkMsPosition = trkMsPosition;
     _inputControls = inputControls;
 }