private void loadTone(ToneParam tone) { param = tone.Clone(); { GameObject obj = transform.FindChild("Panel/LFO").gameObject; setSliderValue(obj, "WaveForm", "lw:", 0, 7, param.Lfo.WS); setSliderValue(obj, "Frequency", "lf:", 0, 127, param.Lfo.LF); setSliderValue(obj, "PMPower", "lp:", 0, 127, param.Lfo.LP); setSliderValue(obj, "AMPower", "la:", 0, 127, param.Lfo.LA); if (param.Extended) { setSliderValue(obj, "AttackRate", "ar:", 0, 127, param.Lfo.Env.xAR); setSliderValue(obj, "DecayRate", "dr:", 0, 127, param.Lfo.Env.xDR); setSliderValue(obj, "SustainLevel", "sl:", 0, 127, param.Lfo.Env.xSL); setSliderValue(obj, "SustainRate", "sr:", 0, 127, param.Lfo.Env.xSR); setSliderValue(obj, "ReleaseRate", "rr:", 0, 127, param.Lfo.Env.xRR); } else { setSliderValue(obj, "AttackRate", "ar:", 0, 31, param.Lfo.Env.AR); setSliderValue(obj, "DecayRate", "dr:", 0, 31, param.Lfo.Env.DR); setSliderValue(obj, "SustainLevel", "sl:", 0, 15, param.Lfo.Env.SL); setSliderValue(obj, "SustainRate", "sr:", 0, 31, param.Lfo.Env.SR); setSliderValue(obj, "ReleaseRate", "rr:", 0, 15, param.Lfo.Env.RR); } } { GameObject obj = transform.FindChild("Panel/ENV").gameObject; setSliderValue(obj, "WaveStyle", "ws:", 0, 7, param.WS); setSliderValue(obj, "KeyScale", "ks:", 0, 3, param.Env.KS); setSliderValue(obj, "VelocitySense", "vs:", 0, 7, param.Env.VS); setSliderValue(obj, "TotalLevel", "tl:", 0, 127, param.Env.TL); if (param.Extended) { setSliderValue(obj, "AttackRate", "ar:", 0, 127, param.Env.xAR); setSliderValue(obj, "DecayRate", "dr:", 0, 127, param.Env.xDR); setSliderValue(obj, "SustainLevel", "sl:", 0, 127, param.Env.xSL); setSliderValue(obj, "SustainRate", "sr:", 0, 127, param.Env.xSR); setSliderValue(obj, "ReleaseRate", "rr:", 0, 127, param.Env.xRR); } else { setSliderValue(obj, "AttackRate", "ar:", 0, 31, param.Env.AR); setSliderValue(obj, "DecayRate", "dr:", 0, 31, param.Env.DR); setSliderValue(obj, "SustainLevel", "sl:", 0, 15, param.Env.SL); setSliderValue(obj, "SustainRate", "sr:", 0, 31, param.Env.SR); setSliderValue(obj, "ReleaseRate", "rr:", 0, 15, param.Env.RR); } } { WaveTable wt = transform.FindChild("Panel/WaveTable").GetComponent <WaveTable>(); for (int i = 0; i < 32; i++) { wt.WT[i] = param.WT[i]; } } updateParam(); }
private void loadTone(ToneParam tone) { param = tone.Clone(); { GameObject obj = gameObject.transform.Find("Panel/FM").gameObject; setSliderValue(obj, "Algorithm", "al:", param.Al); setSliderValue(obj, "Feedback", "fb:", param.Fb); setSliderValue(obj, "WaveForm", "lw:", param.Lfo.WS); setSliderValue(obj, "Frequency", "lf:", param.Lfo.LF); setSliderValue(obj, "PMPower", "lp:", param.Lfo.LP); setSliderValue(obj, "AMPower", "la:", param.Lfo.LA); setSliderValue(obj, "AttackRate", "ar:", param.Lfo.Env.AR); setSliderValue(obj, "DecayRate", "dr:", param.Lfo.Env.DR); setSliderValue(obj, "SustainLevel", "sl:", param.Lfo.Env.SL); setSliderValue(obj, "SustainRate", "sr:", param.Lfo.Env.SR); setSliderValue(obj, "ReleaseRate", "rr:", param.Lfo.Env.RR); } for (int i = 0; i < 4; i++) { int n = i; GameObject obj = gameObject.transform.Find("Panel/OP" + (i + 1)).gameObject; setSliderValue(obj, "WaveStyle", "ws:", param.Op[n].WS); setSliderValue(obj, "AMEnable", "ae:", param.Op[n].AE); setSliderValue(obj, "Multiple", "ml:", param.Op[n].Ml); setSliderValue(obj, "Detune", "dt:", param.Op[n].Dt); setSliderValue(obj, "KeyScale", "ks:", param.Op[n].Env.KS); setSliderValue(obj, "VelocitySense", "vs:", param.Op[n].Env.VS); setSliderValue(obj, "TotalLevel", "tl:", param.Op[n].Env.TL); setSliderValue(obj, "AttackRate", "ar:", param.Op[n].Env.AR); setSliderValue(obj, "DecayRate", "dr:", param.Op[n].Env.DR); setSliderValue(obj, "SustainLevel", "sl:", param.Op[n].Env.SL); setSliderValue(obj, "SustainRate", "sr:", param.Op[n].Env.SR); setSliderValue(obj, "ReleaseRate", "rr:", param.Op[n].Env.RR); } if (musicPlayer.Synthesizer != null) { musicPlayer.Synthesizer.Channel[ChNo].ProgramChange(param); } }
private void applyTone() { syntheStation.Instrument[PortNo].Channel[ChNo].ProgramChange(param.Clone()); inputField.text = param.ToString(); }