Ejemplo n.º 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);
        }
Ejemplo n.º 2
0
        //protected float[] panTable = new float[4] { 1.0f, 0.5012f, 0.2512f, 0.1000f };

        public ADPCMA(int num, reverb reverb, distortion distortion, chorus chorus, effect.HPFLPF hpflpf, effect.ReversePhase reversePhase, effect.Compressor compressor, int revStartCh)
        {
            this.num          = num;
            this.reversePhase = reversePhase;
            this.reverb       = reverb;
            this.distortion   = distortion;
            this.chorus       = chorus;
            this.hpflpf       = hpflpf;
            this.compressor   = compressor;

            this.revStartCh = revStartCh;
            this.buf        = null;
            this.size       = 0;
            for (int i = 0; i < 6; i++)
            {
                channel[i].panL   = 1.0f;
                channel[i].panR   = 1.0f;
                channel[i].level  = 0;
                channel[i].volume = 0;
                channel[i].pos    = 0;
                channel[i].step   = 0;
                channel[i].volume = 0;
                channel[i].start  = 0;
                channel[i].stop   = 0;
                channel[i].adpcmx = 0;
                channel[i].adpcmd = 0;
            }
            this.tl   = 0;
            this.key  = 0;
            this.tvol = 0;

            InitADPCMATable();
        }
Ejemplo n.º 3
0
 public Rhythm(int num, reverb reverb, distortion distortion, chorus chorus, effect.HPFLPF hpflpf, effect.ReversePhase reversePhase, effect.Compressor compressor, int efcCh)
 {
     this.reverb       = reverb;
     this.distortion   = distortion;
     this.chorus       = chorus;
     this.hpflpf       = hpflpf;
     this.efcCh        = efcCh;
     this.reversePhase = reversePhase;
     this.compressor   = compressor;
     this.num          = num;
 }
Ejemplo n.º 4
0
 public PSG2(int num, reverb reverb, distortion distortion, chorus chorus, effect.HPFLPF hpflpf, effect.ReversePhase reversePhase, effect.Compressor compressor, int efcStartCh)
 {
     this.num          = num;
     this.reverb       = reverb;
     this.distortion   = distortion;
     this.chorus       = chorus;
     this.hpflpf       = hpflpf;
     this.reversePhase = reversePhase;
     this.compressor   = compressor;
     this.efcStartCh   = efcStartCh;
     makeTblGetSample();
 }
Ejemplo n.º 5
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);
        }
Ejemplo n.º 6
0
        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];
        }
Ejemplo n.º 7
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];
        }