public frmMIDI(frmMain frm, int chipID, int zoom, MIDIParam newParam) { parent = frm; this.chipID = chipID; this.zoom = zoom; InitializeComponent(); this.newParam = newParam; frameBuffer.Add(pbScreen, Properties.Resources.planeMIDI_GM, null, zoom); DrawBuff.screenInitMIDI(frameBuffer); update(); }
public void screenChangeParams() { MIDIParam prm = Audio.GetMIDIInfos(chipID); for (int ch = 0; ch < 16; ch++) { for (int i = 0; i < 256; i++) { newParam.cc[ch][i] = prm.cc[ch][i]; } newParam.bend[ch] = prm.bend[ch]; for (int i = 0; i < 128; i++) { newParam.note[ch][i] = prm.note[ch][i]; } newParam.level[ch][0] = prm.level[ch][0]; newParam.level[ch][1] = prm.level[ch][1]; newParam.level[ch][2] = prm.level[ch][2]; newParam.level[ch][3] = prm.level[ch][3]; newParam.level[ch][4] = prm.level[ch][4]; if (prm.level[ch][0] > 0) { prm.level[ch][0] -= 3; if (prm.level[ch][0] < 0) { prm.level[ch][0] = 0; } } if (prm.level[ch][1] > 0) { prm.level[ch][1] -= 3; if (prm.level[ch][1] < 0) { prm.level[ch][1] = 0; } } if (prm.level[ch][2] > 0) { prm.level[ch][2] -= 3; if (prm.level[ch][2] < 0) { prm.level[ch][2] = 0; } } if (prm.level[ch][3] > 0) { prm.level[ch][4] -= 3; if (prm.level[ch][4] < 0) { prm.level[ch][4] = 0; prm.level[ch][3] -= 3; if (prm.level[ch][3] < 0) { prm.level[ch][3] = 0; } } } newParam.pc[ch] = prm.pc[ch]; newParam.nrpnVibRate[ch] = prm.nrpnVibRate[ch]; newParam.nrpnVibDepth[ch] = prm.nrpnVibDepth[ch]; newParam.nrpnVibDelay[ch] = prm.nrpnVibDelay[ch]; newParam.nrpnLPF[ch] = prm.nrpnLPF[ch]; newParam.nrpnLPFRsn[ch] = prm.nrpnLPFRsn[ch]; newParam.nrpnHPF[ch] = prm.nrpnHPF[ch]; newParam.nrpnEQBaseFrq[ch] = prm.nrpnEQBaseFrq[ch]; newParam.nrpnEQBaseGain[ch] = prm.nrpnEQBaseGain[ch]; newParam.nrpnEQTrebleFrq[ch] = prm.nrpnEQTrebleFrq[ch]; newParam.nrpnEQTrebleGain[ch] = prm.nrpnEQTrebleGain[ch]; newParam.nrpnEGAttack[ch] = prm.nrpnEGAttack[ch]; newParam.nrpnEGDecay[ch] = prm.nrpnEGDecay[ch]; newParam.nrpnEGRls[ch] = prm.nrpnEGRls[ch]; } newParam.MIDIModule = prm.MIDIModule; //Display Data for (int i = 0; i < 64; i++) { newParam.LCDDisplay[i] = prm.LCDDisplay[i]; } newParam.LCDDisplayTime = prm.LCDDisplayTime; prm.LCDDisplayTime -= 3; if (prm.LCDDisplayTime < 0) { prm.LCDDisplayTime = 0; } for (int i = 0; i < prm.LCD8850Display.Length; i++) { newParam.LCD8850Display[i] = prm.LCD8850Display[i]; } newParam.LCD8850DisplayTime = prm.LCD8850DisplayTime; if (newParam.LCD8850DisplayTime != 400) { prm.LCD8850DisplayTime -= 3; } if (prm.LCD8850DisplayTime < 0) { prm.LCD8850DisplayTime = 0; } newParam.LCDDisplayTimeXG = prm.LCDDisplayTimeXG; prm.LCDDisplayTimeXG -= 3; if (prm.LCDDisplayTimeXG < 0) { prm.LCDDisplayTimeXG = 0; } //Display Letter Data for (int i = 0; i < 32; i++) { newParam.LCDDisplayLetter[i] = prm.LCDDisplayLetter[i]; } newParam.LCDDisplayLetterLen = prm.LCDDisplayLetterLen; newParam.LCDDisplayLetterTime = prm.LCDDisplayLetterTime; prm.LCDDisplayLetterTime -= 3; if (prm.LCDDisplayLetterTime < 0) { if (prm.LCDDisplayLetterLen > 0) { for (int i = 1; i < 32; i++) { prm.LCDDisplayLetter[i - 1] = (byte)(i < prm.LCDDisplayLetterLen ? prm.LCDDisplayLetter[i] : 0x20); } prm.LCDDisplayLetterTime = 40; prm.LCDDisplayLetterLen--; } else { prm.LCDDisplayLetterTime = 0; } } newParam.LCDDisplayLetterTimeXG = prm.LCDDisplayLetterTimeXG; prm.LCDDisplayLetterTimeXG -= 3; if (prm.LCDDisplayLetterTimeXG < 0) { prm.LCDDisplayLetterTimeXG = 0; } newParam.ReverbGS = prm.ReverbGS; newParam.ChorusGS = prm.ChorusGS; newParam.DelayGS = prm.DelayGS; newParam.EFXGS = prm.EFXGS; newParam.ReverbXG = prm.ReverbXG; newParam.ChorusXG = prm.ChorusXG; newParam.VariationXG = prm.VariationXG; newParam.Insertion1XG = prm.Insertion1XG; newParam.Insertion2XG = prm.Insertion2XG; newParam.Insertion3XG = prm.Insertion3XG; newParam.Insertion4XG = prm.Insertion4XG; newParam.MasterVolume = prm.MasterVolume; newParam.Lyric = prm.Lyric; }