Beispiel #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);
        }
Beispiel #2
0
        public void LoadMetaInstruments(string song)
        {
            for (int i = 0; i < longSamples.Count; i++)
            {
                longSamples[i].info = CTRJson.GetMetaInst(song, "long", i);
            }

            for (int i = 0; i < shortSamples.Count; i++)
            {
                shortSamples[i].info = CTRJson.GetMetaInst(song, "short", i);
            }
        }
Beispiel #3
0
        public void LoadMeta()
        {
            if (!CTRJson.Load())
            {
                MessageBox.Show("Couldn't load Json!");
            }
            else
            {
                listBox1.Items.Clear();
                comboBox1.Items.Clear();

                foreach (KeyValuePair <string, JToken> j in CTRJson.midi)
                {
                    listBox1.Items.Add(j.Key);
                    comboBox1.Items.Add(j.Key);
                }
            }
        }