public SignalSoundEvent(SignalSoundEvent ev) : base(ev) { _sig = ev._sig; _modif = ev._modif; _paramNumber = ev._paramNumber; _parentsDSP = ev._parentsDSP; _parentsOsc = ev._parentsOsc; }
internal override void NotifyNewParent(SoundEvent parent) { base.NotifyNewParent(parent); if (_modif == Modifier.DSP_PARAM) { if (parent is DSPSoundEvent) { _parentsDSP = (DSPSoundEvent)parent; } if (parent is OscSoundEvent) { _parentsOsc = (OscSoundEvent)parent; } } // else TODO }
internal override void NotifyNewParent(SoundEvent parent) { base.NotifyNewParent(parent); if ( _modif == Modifier.DSP_PARAM ) { if (parent is DSPSoundEvent ) _parentsDSP = (DSPSoundEvent)parent; if (parent is OscSoundEvent) _parentsOsc = (OscSoundEvent)parent; } // else TODO }
public DSPSoundEvent(DSPSoundEvent ev) : base(ev) { _dsp = ev._dsp; }
/** * complex script sequence for testing */ public SoundEvent Test_Script1() { SoundEvent soundScript = new SoundEvent("Test_Script1"); SampleSoundEvent evDing = new SampleSoundEvent("ding.wav"); SampleSoundEvent evOrgan = new SampleSoundEvent("hammond-loop.wav"); // dsp effects SoundEvent evEcho = new DSPSoundEvent(FMOD.DSP_TYPE.ECHO); //evEmerald.AddEvent(0,echo1); SoundEvent evChorus = new DSPSoundEvent(FMOD.DSP_TYPE.CHORUS); evChorus.UpdateDuration(10.0); evOrgan.AddEvent(evOrgan.Duration, evChorus); DSPSoundEvent evLP = new DSPSoundEvent(FMOD.DSP_TYPE.LOWPASS); evLP.UpdateDuration(10.0); Signal sigLP = new Signal(new List<double>() { 0,300, 3,1500, 7,300, 20,15050 }); SignalSoundEvent evLPsig = new SignalSoundEvent(SignalSoundEvent.Modifier.DSP_PARAM, sigLP, (int)FMOD.DSP_LOWPASS.CUTOFF); evLP.AddEvent(0, evLPsig); evOrgan.AddEvent(0, evLP); evOrgan.Amplitude = 0.4; evOrgan.Repeat = 10; soundScript.AddEvent(0.5, evOrgan); // create an event defining a signal, which modifies amplitude - linear fade in! Signal sig = new Signal(new List<double>() {0,0, 4,1 } ); SignalSoundEvent evsig = new SignalSoundEvent(SignalSoundEvent.Modifier.AMPLITUDE, sig); evOrgan.AddEvent(0.0, evsig); // composite event SoundEvent evc = new SoundEvent(); evc.AddEvent(0, evDing); evDing = new SampleSoundEvent(evDing); evDing.Amplitude = 0.8; evDing.Pan = -0.5; evc.AddEvent(0.33, evDing); evDing = new SampleSoundEvent(evDing); evDing.Amplitude = 0.6; evDing.Pan = 0.5; evc.AddEvent(0.66, evDing); evDing = new SampleSoundEvent(evDing); evDing.Amplitude = 0.4; evDing.Pan = 0.0; evc.AddEvent(1.0, evDing); evDing = new SampleSoundEvent(evDing); evDing.Amplitude = 0.3; evc.AddEvent(1.33, evDing); evDing = new SampleSoundEvent(evDing); evDing.Amplitude = 0.25; evc.AddEvent(1.66, evDing); // add it to script soundScript.AddEvent(2.0, evc); soundScript.AddEvent(2.5, evc ); evDing = new SampleSoundEvent(evDing); evDing.Amplitude = 0.91; evDing.Pan = -0.9; soundScript.AddEvent(0, evDing); evDing = new SampleSoundEvent(evDing); evDing.Amplitude = 0.92; evDing.Pan = +1; soundScript.AddEvent(0.5, evDing); evDing = new SampleSoundEvent(evDing); evDing.Amplitude = 0.93; evDing.Pan = -1; soundScript.AddEvent(1.0, evDing); // try oscillator OscSoundEvent oscEv = new OscSoundEvent(320); oscEv.Amplitude = 0.1; SignalSoundEvent sEv = new SignalSoundEvent( SignalSoundEvent.Modifier.AMPLITUDE , new Signal( new List<double>() { 0,0 , 0.5,1 , 2,1 , 2.5,0 , 3.0,0 } ) ); SignalSoundEvent sEv2 = new SignalSoundEvent(SignalSoundEvent.Modifier.DSP_PARAM, new Signal(new List<double>() { 0, 320, 0.5, 543, 2, 129, 2.5, 192.3, 3.0, 410 }), (int) FMOD.DSP_OSCILLATOR.RATE); oscEv.AddEvent(0.0, sEv); oscEv.AddEvent(0.0, sEv2); soundScript.AddEvent(3.0, oscEv); soundScript.AddEvent(7.0, oscEv); soundScript.AddEvent(11.0, oscEv); soundScript.AddEvent(15.0, oscEv); return soundScript; }