Exemplo n.º 1
0
 public void EndQuick(float outSampleRate)
 {
     AmpEnv.Parameters.Release = 0.0f;
     AmpEnv.NextSegment(VoiceEnvelopeSegment.Sustain, outSampleRate);
     ModEnv.Parameters.Release = 0.0f;
     ModEnv.NextSegment(VoiceEnvelopeSegment.Sustain, outSampleRate);
 }
Exemplo n.º 2
0
 public void End(float outSampleRate)
 {
     AmpEnv.NextSegment(VoiceEnvelopeSegment.Sustain, outSampleRate);
     ModEnv.NextSegment(VoiceEnvelopeSegment.Sustain, outSampleRate);
     if (Region.LoopMode == LoopMode.Sustain)
     {
         // Continue playing, but stop looping.
         LoopEnd = LoopStart;
     }
 }
Exemplo n.º 3
0
        public void Clear(bool forRelative)
        {
            LoopMode       = 0;
            SampleRate     = 0;
            LoKey          = 0;
            HiKey          = 0;
            LoVel          = 0;
            HiVel          = 0;
            Group          = 0;
            Offset         = 0;
            End            = 0;
            LoopStart      = 0;
            LoopEnd        = 0;
            Transpose      = 0;
            Tune           = 0;
            PitchKeyCenter = 0;
            PitchKeyTrack  = 0;
            Attenuation    = 0;
            Pan            = 0;
            AmpEnv.Clear();
            ModEnv.Clear();
            InitialFilterQ   = 0;
            InitialFilterFc  = 0;
            ModEnvToPitch    = 0;
            ModEnvToFilterFc = 0;
            ModLfoToFilterFc = 0;
            ModLfoToVolume   = 0;
            DelayModLFO      = 0;
            FreqModLFO       = 0;
            ModLfoToPitch    = 0;
            DelayVibLFO      = 0;
            FreqVibLFO       = 0;
            VibLfoToPitch    = 0;

            HiKey          = HiVel = 127;
            PitchKeyCenter = 60; // C4
            if (forRelative)
            {
                return;
            }

            PitchKeyTrack = 100;

            PitchKeyCenter = -1;

            // SF2 defaults in timecents.
            AmpEnv.Delay = AmpEnv.Attack = AmpEnv.Hold = AmpEnv.Decay = AmpEnv.Release = -12000.0f;
            ModEnv.Delay = ModEnv.Attack = ModEnv.Hold = ModEnv.Decay = ModEnv.Release = -12000.0f;

            InitialFilterFc = 13500;

            DelayModLFO = -12000.0f;
            DelayVibLFO = -12000.0f;
        }