public NoteOff(NoteOn noteOn, SeqRef seqRef, TrkOptions trkOptions) : base(seqRef, new List<int>(), trkOptions) { foreach(TrkRef tr in noteOn.SeqRef.TrkRefs) { _trkOffs.Add(tr.MidiChannel); } }
private InputVoiceDef GetBar2InputVoiceDef(Seq bar2Seq) { InputVoiceDef ivd = new InputVoiceDef(0, 0, new List<IUniqueDef>()); ivd.MsPositionReContainer = bar2Seq.AbsMsPosition; foreach(Trk trk in bar2Seq.Trks) { MidiChordDef firstMidiChordDef = null; foreach(IUniqueDef iud in trk.UniqueDefs) { firstMidiChordDef = iud as MidiChordDef; if(firstMidiChordDef != null) { List<TrkRef> trkRefs = new List<TrkRef>(); trkRefs.Add(new TrkRef((byte)trk.MidiChannel, bar2Seq.AbsMsPosition + firstMidiChordDef.MsPositionReFirstUD, 12, null)); SeqRef seqRef = new SeqRef(trkRefs, null); NoteOn noteOn = new NoteOn(seqRef); List<InputNoteDef> inputNoteDefs = new List<InputNoteDef>(); inputNoteDefs.Add(new InputNoteDef((byte)65, noteOn, null)); InputChordDef icd = new InputChordDef(firstMidiChordDef.MsPositionReFirstUD, 1500, inputNoteDefs, M.Dynamic.none, null); ivd.Add(icd); break; } } } return ivd; }
private InputVoiceDef GetBar1InputVoiceDef(Seq bar1Seq) { InputVoiceDef ivd = new InputVoiceDef(0, 0, new List<IUniqueDef>()); ivd.MsPositionReContainer = bar1Seq.AbsMsPosition; Trk leadTrk = null; foreach(Trk trk in bar1Seq.Trks) { if(trk.MidiChannel == 0) { leadTrk = trk; break; } } Debug.Assert(leadTrk != null); foreach(IUniqueDef tIud in leadTrk) { RestDef tRestDef = tIud as RestDef; MidiChordDef tmcd = tIud as MidiChordDef; if(tRestDef != null) { RestDef iRestDef = new RestDef(tRestDef.MsPositionReFirstUD, tRestDef.MsDuration); ivd.Add(iRestDef); } else if(tmcd != null) { List<TrkRef> trkRefs = new List<TrkRef>(); foreach(Trk trk in bar1Seq.Trks) { trkRefs.Add(new TrkRef((byte)trk.MidiChannel, bar1Seq.AbsMsPosition + tmcd.MsPositionReFirstUD, 1, null)); } SeqRef seqRef = new SeqRef(trkRefs, null); NoteOn noteOn = new NoteOn(seqRef); List<InputNoteDef> inputNoteDefs = new List<InputNoteDef>(); foreach(byte notatedMidiPitch in tmcd.NotatedMidiPitches) { inputNoteDefs.Add(new InputNoteDef((byte)(notatedMidiPitch + 36), noteOn, null)); } InputChordDef icd = new InputChordDef(tIud.MsPositionReFirstUD, tIud.MsDuration, inputNoteDefs, M.Dynamic.none, null); ivd.Add(icd); } } return ivd; }
protected NoteTrigger(SeqRef seqRef, List<int> trkOffs, TrkOptions trkOptions) { _seqRef = seqRef; _trkOffs = trkOffs; _trkOptions = trkOptions; }
// a NoteOn that uses no continuous controllers, turns no trks off, and has no trkOptions. public NoteOn(SeqRef seqRef) : base(seqRef, new List<int>(), null) { }
public NoteOn(SeqRef seqRef, List<int> trkOffs, TrkOptions trkOptions) : base(seqRef, trkOffs, trkOptions) { }