Ejemplo n.º 1
0
        internal NoiseChannel(Memory  memory, FrameSequencer frameSequencer,
                          int sampleRate, int numChannels, 
                          int sampleSize, int channelIndex)
        {
            _memory = memory;
              _frameSequencer = frameSequencer;

              SampleRate = sampleRate;
              _msSampleRate = SampleRate / 1000;
              NumChannels = numChannels;
              SampleSize = sampleSize;
              _buffer = new short[SampleRate * NumChannels * SampleSize * _milliseconds / 1000];

              _channelIndex = channelIndex;
              _soundEventQueue = new SoundEventQueue(1000);
        }
Ejemplo n.º 2
0
        internal NoiseChannel(Memory memory, FrameSequencer frameSequencer,
                              int sampleRate, int numChannels,
                              int sampleSize, int channelIndex)
        {
            _memory         = memory;
            _frameSequencer = frameSequencer;

            SampleRate    = sampleRate;
            _msSampleRate = SampleRate / 1000;
            NumChannels   = numChannels;
            SampleSize    = sampleSize;
            _buffer       = new short[SampleRate * NumChannels * SampleSize * _milliseconds / 1000];

            _channelIndex    = channelIndex;
            _soundEventQueue = new SoundEventQueue(1000);
        }
Ejemplo n.º 3
0
        internal SquareChannel(Memory memory, FrameSequencer frameSequencer,
                           int sampleRate, int numChannels, int sampleSize, int channelIndex,
                           MMR sweepRegister, MMR wavePatternDutyRegister, MMR volumeEnvelopeRegister,
                           MMR freqLowRegister, MMR freqHighRegister)
        {
            _memory = memory;
              _frameSequencer = frameSequencer;

              SampleRate = sampleRate;
              _msSampleRate = SampleRate / 1000;
              NumChannels = numChannels;
              SampleSize = sampleSize;
              _buffer = new short[SampleRate * NumChannels * SampleSize * _milliseconds / 1000];

              _channelIndex = channelIndex;
              _soundEventQueue = new SoundEventQueue(1000);

              // Register setup
              _sweepRegister = sweepRegister;
              _wavePatternDutyRegister = wavePatternDutyRegister;
              _volumeEnvelopeRegister = volumeEnvelopeRegister;
              _freqLowRegister = freqLowRegister;
              _freqHighRegister = freqHighRegister;
        }
Ejemplo n.º 4
0
        internal SquareChannel(Memory memory, FrameSequencer frameSequencer,
                               int sampleRate, int numChannels, int sampleSize, int channelIndex,
                               MMR sweepRegister, MMR wavePatternDutyRegister, MMR volumeEnvelopeRegister,
                               MMR freqLowRegister, MMR freqHighRegister)
        {
            _memory         = memory;
            _frameSequencer = frameSequencer;

            SampleRate    = sampleRate;
            _msSampleRate = SampleRate / 1000;
            NumChannels   = numChannels;
            SampleSize    = sampleSize;
            _buffer       = new short[SampleRate * NumChannels * SampleSize * _milliseconds / 1000];

            _channelIndex    = channelIndex;
            _soundEventQueue = new SoundEventQueue(1000);

            // Register setup
            _sweepRegister           = sweepRegister;
            _wavePatternDutyRegister = wavePatternDutyRegister;
            _volumeEnvelopeRegister  = volumeEnvelopeRegister;
            _freqLowRegister         = freqLowRegister;
            _freqHighRegister        = freqHighRegister;
        }