//--------------------------------------------------- void initDrumVoice() { ampSmoothValue = 0.1f; int i; for(i=0;i<NUM_VOICES;i++) { SnapEg_init(&voiceArray[i].snapEg); setPan(i,0.f); voiceArray[i].vol = 0.8f; //voiceArray[i].panModifier = 1.f; voiceArray[i].fmModAmount = 0.5f; transient_init(&voiceArray[i].transGen); #if ENABLE_DRUM_SVF SVF_init(&voiceArray[i].filter); voiceArray[i].filterType = 0x01; #endif lfo_init(&voiceArray[i].lfo); voiceArray[i].modOsc.freq = 440; voiceArray[i].modOsc.waveform = 1; voiceArray[i].modOsc.fmMod = 0; voiceArray[i].modOsc.midiFreq = 70<<8; voiceArray[i].modOsc.pitchMod = 1.0f; voiceArray[i].modOsc.modNodeValue = 1; voiceArray[i].volumeMod = 1; voiceArray[i].osc.freq = 440; voiceArray[i].osc.modNodeValue = 1; voiceArray[i].osc.waveform = TRI+i; //for testing init to tri,saw,rec voiceArray[i].osc.fmMod = 0; voiceArray[i].osc.midiFreq = 70<<8; DecayEg_init(&voiceArray[i].oscPitchEg); voiceArray[i].egPitchModAmount = 0.5f; slopeEg2_init(&voiceArray[i].oscVolEg); setDistortionShape(&voiceArray[i].distortion, 2.f); #ifdef USE_AMP_FILTER initOnePole(&voiceArray[i].ampFilter); setOnePoleCoef(&voiceArray[i].ampFilter,ampSmoothValue); #endif #if ENABLE_MIX_OSC voiceArray[i].mixOscs = true; #endif voiceArray[i].decimationCnt = 0; voiceArray[i].decimationRate = 1; } }
void Cymbal_init() { SnapEg_init(&cymbalVoice.snapEg); Cymbal_setPan(0); cymbalVoice.vol = 0.8f; //cymbalVoice.panModifier = 1.f; transient_init(&cymbalVoice.transGen); cymbalVoice.fmModAmount1 = 0.5f; cymbalVoice.fmModAmount2 = 0.5f; setDistortionShape(&cymbalVoice.distortion, 2.f); cymbalVoice.modOsc.freq = 440; cymbalVoice.modOsc.waveform = SINE; cymbalVoice.modOsc.fmMod = 0; cymbalVoice.modOsc.midiFreq = 70<<8; cymbalVoice.modOsc.pitchMod = 1.0f; cymbalVoice.modOsc.modNodeValue = 1; cymbalVoice.modOsc2.freq = 440; cymbalVoice.modOsc2.waveform = NOISE;//SINE; cymbalVoice.modOsc2.fmMod = 0; cymbalVoice.modOsc2.midiFreq = 70<<8; cymbalVoice.modOsc2.pitchMod = 1.0f; cymbalVoice.modOsc2.modNodeValue = 1; cymbalVoice.osc.freq = 440; cymbalVoice.osc.waveform = 1; cymbalVoice.osc.fmMod = 1; cymbalVoice.osc.midiFreq = 70<<8; cymbalVoice.osc.pitchMod = 1.0f; cymbalVoice.osc.modNodeValue = 1; cymbalVoice.volumeMod = 1; slopeEg2_init(&cymbalVoice.oscVolEg); SVF_init(&cymbalVoice.filter); lfo_init(&cymbalVoice.lfo); }
//--------------------------------------------------- void Snare_init() { SnapEg_init(&snareVoice.snapEg); Snare_setPan(0.f); snareVoice.vol = 0.8f; snareVoice.panModifier = 1.f; snareVoice.noiseOsc.freq = 440; snareVoice.noiseOsc.waveform = 1; snareVoice.noiseOsc.fmMod = 0; snareVoice.noiseOsc.midiFreq = 70<<8; snareVoice.noiseOsc.pitchMod = 1.0f; snareVoice.noiseOsc.modNodeValue = 1; snareVoice.osc.freq = 440; snareVoice.osc.waveform = 1; snareVoice.osc.fmMod = 0; snareVoice.osc.midiFreq = 70<<8; snareVoice.osc.modNodeValue = 1; setDistortionShape(&snareVoice.distortion, 2.f); snareVoice.volumeMod = 1; transient_init(&snareVoice.transGen); DecayEg_init(&snareVoice.oscPitchEg); snareVoice.egPitchModAmount = 0.5f; slopeEg2_init(&snareVoice.oscVolEg); setDistortionShape(&snareVoice.distortion, 2.f); SVF_init(&snareVoice.filter); lfo_init(&snareVoice.lfo); }