Exemplo n.º 1
0
        public List <MidiEvent> ToMidiEventList(CSeqHeader header, int channel, CSEQ seq)
        {
            List <MidiEvent> me = new List <MidiEvent>();
            //MidiEvent x;

            int absTime = 0;

            me.Add(new TextEvent(name, MetaEventType.SequenceTrackName, absTime));
            me.Add(new TempoEvent(header.MPQN, absTime));

            if (channel == 10)
            {
                me.Add(new ControlChangeEvent(absTime, channel, MidiController.BankSelect, 120));
                me.Add(new ControlChangeEvent(absTime, channel, MidiController.BankSelect, 0));
                me.Add(new PatchChangeEvent(absTime, channel, CTRJson.GetBankIndex(CSEQ.PatchName)));
            }

            if (CSEQ.UseSampleVolumeForTracks && !CSEQ.IgnoreVolume)
            {
                me.Add(new ControlChangeEvent(absTime, channel, MidiController.MainVolume, seq.samplesReverb[instrument].Volume / 2));
            }

            foreach (Command c in cmd)
            {
                me.AddRange(c.ToMidiEvent(absTime, channel, seq, this));
                absTime += c.wait;
            }

            return(me);
        }
Exemplo n.º 2
0
 public Sequence()
 {
     header = new CSeqHeader();
     tracks = new List <CTrack>();
 }