Example #1
0
        public override uint Start(byte ChipID, uint clock, uint FMClockValue, params object[] option)
        {
            reverb[ChipID]       = new reverb((int)clock, MaxCh);
            distortion[ChipID]   = new distortion((int)clock, MaxCh);
            chorus[ChipID]       = new chorus((int)clock, MaxCh);
            ep3band[ChipID]      = new fmvgen.effect.eq3band((int)clock);
            hpflpf[ChipID]       = new fmvgen.effect.HPFLPF((int)clock, MaxCh);
            reversePhase[ChipID] = new fmvgen.effect.ReversePhase();
            compressor[ChipID]   = new fmvgen.effect.Compressor((int)clock, MaxCh);
            chip[ChipID]         = new fmvgen.OPNA2(reverb[ChipID], distortion[ChipID], chorus[ChipID], ep3band[ChipID], hpflpf[ChipID], reversePhase[ChipID], compressor[ChipID]);

            if (option != null && option.Length > 0 && option[0] is Func <string, Stream> )
            {
                if (option[0] is Func <string, Stream> )
                {
                    chip[ChipID].Init(FMClockValue, clock, false, (Func <string, Stream>)option[0]);
                }
                else if (option[0] is string)
                {
                    chip[ChipID].Init(FMClockValue, clock, false, (string)option[0]);
                }
            }
            else
            {
                chip[ChipID].Init(FMClockValue, clock);
            }

            return(clock);
        }
Example #2
0
        public override uint Start(byte ChipID, uint clock)
        {
            reverb[ChipID]       = new reverb((int)clock, MaxCh);
            distortion[ChipID]   = new distortion((int)clock, MaxCh);
            chorus[ChipID]       = new chorus((int)clock, MaxCh);
            ep3band[ChipID]      = new fmvgen.effect.eq3band((int)clock);
            hpflpf[ChipID]       = new fmvgen.effect.HPFLPF((int)clock, MaxCh);
            reversePhase[ChipID] = new fmvgen.effect.ReversePhase();
            compressor[ChipID]   = new fmvgen.effect.Compressor((int)clock, MaxCh);
            chip[ChipID]         = new fmvgen.OPNA2(reverb[ChipID], distortion[ChipID], chorus[ChipID], ep3band[ChipID], hpflpf[ChipID], reversePhase[ChipID], compressor[ChipID]);
            chip[ChipID].Init(DefaultYM2609ClockValue, clock);

            return(clock);
        }
Example #3
0
        // ---------------------------------------------------------------------------
        //	構築
        //
        public OPNA2(reverb reverb, distortion distortion, chorus chorus, effect.eq3band ep3band, effect.HPFLPF hpflpf, effect.ReversePhase reversePhase, effect.Compressor compressor)
        {
            this.reverb       = reverb;
            this.distortion   = distortion;
            this.chorus       = chorus;
            this.ep3band      = ep3band;
            this.hpflpf       = hpflpf;
            this.reversePhase = reversePhase;
            this.compressor   = compressor;

            fm6 = new FM6[2] {
                new FM6(0, reverb, distortion, chorus, hpflpf, reversePhase, compressor, 0, dicOpeWav),
                new FM6(1, reverb, distortion, chorus, hpflpf, reversePhase, compressor, 6, dicOpeWav)
            };
            psg2 = new PSG2[4] {
                new PSG2(0, reverb, distortion, chorus, hpflpf, reversePhase, compressor, 12),
                new PSG2(1, reverb, distortion, chorus, hpflpf, reversePhase, compressor, 15),
                new PSG2(2, reverb, distortion, chorus, hpflpf, reversePhase, compressor, 18),
                new PSG2(3, reverb, distortion, chorus, hpflpf, reversePhase, compressor, 21)
            };
            adpcmb = new ADPCMB[3] {
                new ADPCMB(0, reverb, distortion, chorus, hpflpf, reversePhase, compressor, 24),
                new ADPCMB(1, reverb, distortion, chorus, hpflpf, reversePhase, compressor, 25),
                new ADPCMB(2, reverb, distortion, chorus, hpflpf, reversePhase, compressor, 26)
            };
            rhythm = new Rhythm[6] {
                new Rhythm(0, reverb, distortion, chorus, hpflpf, reversePhase, compressor, 27),
                new Rhythm(1, reverb, distortion, chorus, hpflpf, reversePhase, compressor, 28),
                new Rhythm(2, reverb, distortion, chorus, hpflpf, reversePhase, compressor, 29),
                new Rhythm(3, reverb, distortion, chorus, hpflpf, reversePhase, compressor, 30),
                new Rhythm(4, reverb, distortion, chorus, hpflpf, reversePhase, compressor, 31),
                new Rhythm(5, reverb, distortion, chorus, hpflpf, reversePhase, compressor, 32)
            };
            adpcma = new ADPCMA(0, reverb, distortion, chorus, hpflpf, reversePhase, compressor, 33);

            for (int i = 0; i < 6; i++)
            {
                rhythm[i].sample = null;
                rhythm[i].pos    = 0;
                rhythm[i].size   = 0;
                rhythm[i].volume = 0;
            }
            rhythmtvol = 0;

            for (int i = 0; i < 2; i++)
            {
                fm6[i].parent = this;
            }

            for (int i = 0; i < 3; i++)
            {
                adpcmb[i].adpcmmask   = (uint)((i == 0) ? 0x3ffff : 0xffffff);
                adpcmb[i].adpcmnotice = 4;
                adpcmb[i].deltan      = 256;
                adpcmb[i].adpcmvol    = 0;
                adpcmb[i].control2    = 0;
                adpcmb[i].shiftBit    = (i == 0) ? 6 : 9;
                adpcmb[i].parent      = this;
            }

            csmch = ch[2];
        }