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); }
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); } }
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); } } }