protected void SetParameter(fmvgen.Channel4 ch, uint addr, uint data) { uint[] slottable = new uint[4] { 0, 2, 1, 3 }; byte[] sltable = new byte[16] { 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 124 }; if ((addr & 3) < 3) { uint slot = slottable[(addr >> 2) & 3]; fmvgen.Operator op = ch.op[slot]; switch ((addr >> 4) & 15) { case 3: // 30-3E DT/MULTI op.SetDT((data >> 4) & 0x07); op.SetMULTI(data & 0x0f); op.SetWaveTypeL((byte)(data >> 7)); break; case 4: // 40-4E TL op.SetTL(data & 0x7f, ((regtc & 0x80) != 0) && (csmch == ch)); op.SetWaveTypeH((byte)(data >> 7)); break; case 5: // 50-5E KS/AR op.SetKS((data >> 6) & 3); op.SetPhaseReset(data & 0x20); op.SetAR((data & 0x1f) * 2); break; case 6: // 60-6E DR/AMON op.SetDR((data & 0x1f) * 2); op.SetAMON((data & 0x80) != 0); op.SetDT2((data & 0x60) >> 5); break; case 7: // 70-7E SR op.SetSR((data & 0x1f) * 2); op.SetFB((data >> 5) & 7); break; case 8: // 80-8E SL/RR op.SetSL(sltable[(data >> 4) & 15]); op.SetRR((data & 0x0f) * 4 + 2); break; case 9: // 90-9E SSG-EC op.SetSSGEC(data & 0x0f); op.SetALGLink(data >> 4); ch.buildAlg(); break; } } }
public FM6(int n) { chip = new fmvgen.Chip(); for (int i = 0; i < 6; i++) { ch[i] = new fmvgen.Channel4(i + n * 6); ch[i].SetChip(chip); ch[i].SetType(fmvgen.OpType.typeN); } csmch = ch[2]; }
public FM6(int n, reverb reverb, distortion distortion, chorus chorus, effect.HPFLPF hpflpf, effect.ReversePhase reversePhase, effect.Compressor compressor, int efcStartCh, Dictionary <int, uint[]> dicOpeWav) { this.num = n; this.reverb = reverb; this.distortion = distortion; this.chorus = chorus; this.hpflpf = hpflpf; this.reversePhase = reversePhase; this.efcStartCh = efcStartCh; this.compressor = compressor; this.dicOpeWav = dicOpeWav; chip = new fmvgen.Chip(); for (int i = 0; i < 6; i++) { ch[i] = new fmvgen.Channel4(i + n * 6); ch[i].SetChip(chip); ch[i].SetType(fmvgen.OpType.typeN); } csmch = ch[2]; }