示例#1
0
        public static void Start(this Oscillator oscillator, short[] data, RegionPair region)
        {
            var sampleRate  = region.Instrument.Sample.SampleRate;
            var loopMode    = region.SampleModes;
            var start       = region.SampleStart;
            var end         = region.SampleEnd;
            var startLoop   = region.SampleStartLoop;
            var endLoop     = region.SampleEndLoop;
            var rootKey     = region.RootKey;
            var coarseTune  = region.CoarseTune;
            var fineTune    = region.FineTune;
            var scaleTuning = region.ScaleTuning;

            oscillator.Start(data, loopMode, sampleRate, start, end, startLoop, endLoop, rootKey, coarseTune, fineTune, scaleTuning);
        }
示例#2
0
        internal Voice(Synthesizer synthesizer)
        {
            this.synthesizer = synthesizer;

            volEnv = new VolumeEnvelope(synthesizer);
            modEnv = new ModulationEnvelope(synthesizer);

            vibLfo = new Lfo(synthesizer);
            modLfo = new Lfo(synthesizer);

            oscillator = new Oscillator(synthesizer);
            filter     = new BiQuadFilter(synthesizer);

            block = new float[synthesizer.BlockSize];
        }
示例#3
0
 public static void Start(this Oscillator oscillator, short[] data, InstrumentRegion region)
 {
     Start(oscillator, data, new RegionPair(PresetRegion.Default, region));
 }