public Envelope(EnvelopeConfig config) { this.config = config; isOff = false; isFinished = false; stage = 0; time = 0; duration = 0; gainsPerSecond = 0; gain = 0; }
public MidiSynth(Table table, float sampleRate, int voiceCount) { #if MIDIF_DEBUG_VISUALIZER WaveVisualizer.Request(0, 1024); #endif this.table = table; this.sampleRate = sampleRate; sampleRateRecip = 1f / sampleRate; masterGain = 1; envelopeConfig = new EnvelopeConfig(table, 120, .01f, 60, .1f, 100, .5f, 0, .01f); this.voiceCount = voiceCount; voices = new Voice[voiceCount]; for (int i = 0; i < voiceCount; i += 1) { voices[i].envelope = new Envelope(envelopeConfig); } Reset(); }