public void Portament(byte aNote, byte aVelocity, SoundfontBase aSoundfont, ref MidiVolume aMidiVolume, ref MidiPitch aMidiPitch, double aSecondsSustain = 0.0d) { Logger.LogNormal("Portament"); generatorEnvelope.Set(aSoundfont, aVelocity, aSecondsSustain); generatorPortament.Portament(aNote, aSoundfont.soundinfo.GetPitch(), ref aMidiPitch); }
public void Oscillate(double[] aBuffer, int aSampleRate, ref MidiVolume aMidiVolume, ref MidiPitch aMidiPitch) { generatorPortament.Update(aSampleRate); double lSampleSpeed = 1.0d / ( double )aSampleRate; double lAddSamples = generatorPortament.noteFrequency * aMidiPitch.GetFrequency() * lSampleSpeed; filterVibrato.Filter(ref lAddSamples, aSampleRate, ref aMidiPitch); generatorEnvelope.Generate(aBuffer, lAddSamples, lSampleSpeed); }
public MidiOscillator(byte aNote, byte aInstrument, byte aVelocity, SoundfontBase aSoundfont, ref MidiVolume aMidiVolume, ref MidiPitch aMidiPitch, double aSecondsSustain = 0.0d) { generatorEnvelope = new GeneratorEnvelope(aSoundfont, aVelocity, aSecondsSustain); filterVibrato = new FilterVibrato(ref aMidiPitch); generatorPortament = new GeneratorPortament(aNote, aSoundfont.soundinfo.GetPitch()); }