void OnDestroy() { using (var block = m_Graph.CreateCommandBlock()) { block.ReleaseDSPNode(m_NoiseFilter); block.ReleaseDSPNode(m_LowPass); } }
void OnDestroy() { using (var block = m_Graph.CreateCommandBlock()) { block.ReleaseDSPNode(m_SineWave); block.ReleaseDSPNode(m_SawWave); block.ReleaseDSPNode(m_MixNode); } }
private void Update() { _MicrophoneClip.GetData(_MicrophoneDataArray, 0); _MicrophoneBuffer.CopyFrom(_MicrophoneDataArray); using (var block = _Graph.CreateCommandBlock()) { block.UpdateAudioKernel <MicrophoneNodeKernel, MicrophoneNode.Parameters, MicrophoneNode.Providers, MicrophoneNode>(new MicrophoneNodeKernel(_MicrophoneBuffer), _Microphone); } _Graph.Update(); }
void OnDisable() { // Command blocks can also be completed via the C# 'using' construct for convenience using (var block = m_Graph.CreateCommandBlock()) { block.Disconnect(m_Connection); block.ReleaseDSPNode(m_Node); } m_Graph.RemoveNodeEventHandler(m_HandlerID); m_Output.Dispose(); }
public static void TerminateAudioSampleNode(this DSPGraph graph, DSPNode node) { using (var block = graph.CreateCommandBlock()) { block.TerminateAudioSampleNode(node); } }
void Start() { var format = ChannelEnumConverter.GetSoundFormatFromSpeakerMode(AudioSettings.speakerMode); var channels = ChannelEnumConverter.GetChannelCountFromSoundFormat(format); AudioSettings.GetDSPBufferSize(out var bufferLength, out var numBuffers); var sampleRate = AudioSettings.outputSampleRate; m_Graph = DSPGraph.Create(format, channels, bufferLength, sampleRate); var driver = new DefaultDSPGraphDriver { Graph = m_Graph }; driver.AttachToDefaultOutput(); using (var block = m_Graph.CreateCommandBlock()) { m_NoiseFilter = block.CreateDSPNode <NoiseFilter.Parameters, NoiseFilter.Providers, NoiseFilter>(); block.AddOutletPort(m_NoiseFilter, 2); m_LowPass = StateVariableFilter.Create(block, StateVariableFilter.FilterType.Lowpass); block.Connect(m_NoiseFilter, 0, m_LowPass, 0); block.Connect(m_LowPass, 0, m_Graph.RootDSP, 0); } }
void Start() { var format = ChannelEnumConverter.GetSoundFormatFromSpeakerMode(AudioSettings.speakerMode); var channels = ChannelEnumConverter.GetChannelCountFromSoundFormat(format); AudioSettings.GetDSPBufferSize(out var bufferLength, out var numBuffers); var sampleRate = AudioSettings.outputSampleRate; m_Graph = DSPGraph.Create(format, channels, bufferLength, sampleRate); var driver = new DefaultDSPGraphDriver { Graph = m_Graph }; driver.AttachToDefaultOutput(); using (var block = m_Graph.CreateCommandBlock()) { m_SineWave = block.CreateDSPNode<SinWaveNode.Parameters, SinWaveNode.Providers, SinWaveNode>(); block.AddOutletPort(m_SineWave, 2, SoundFormat.Stereo); m_SawWave = block.CreateDSPNode<SawWaveNode.Parameters, SawWaveNode.Providers, SawWaveNode>(); block.AddOutletPort(m_SawWave, 2, SoundFormat.Stereo); m_MixNode = block.CreateDSPNode<MixNode.Parameters, MixNode.Providers, MixNode>(); block.AddInletPort(m_MixNode, 2, SoundFormat.Stereo); block.AddInletPort(m_MixNode, 2, SoundFormat.Stereo); block.AddOutletPort(m_MixNode, 2, SoundFormat.Stereo); block.Connect(m_SineWave, 0, m_MixNode, 0); block.Connect(m_SawWave, 0, m_MixNode, 1); block.Connect(m_MixNode, 0, m_Graph.RootDSP, 0); } }
void Update() { if (_Initialized == false) { return; } if (_Waiting) { // if(_Request.Done) // { // UpdateRequestFinished(_Request); // } } else { using (DSPCommandBlock block = _Graph.CreateCommandBlock()) { _Waiting = true; block.CreateUpdateRequest <ScopeUpdateKernel, ScopeNode.Parameters, ScopeNode.Providers, ScopeNode>(new ScopeUpdateKernel(_BufferX), _ScopeNode, req => { UpdateRequestFinished(req); req.Dispose(); }); } } }
public virtual void UpdateParameters() { if (!DSPReady) { return; } using (var block = DSPGraph.CreateCommandBlock()) { AddUpdateParametersToBlock(block); } }
public override void OnCreateConnection(NodePort from, NodePort to) { // assuming only inputs handle dsp connections if (DSPReady && from.node == this) { Debug.LogFormat("OnCreateConnection {0} {1}", from.fieldName, to.fieldName); var outputDspPort = GetDSPPortAttribute(from); var inputDspPort = GetDSPPortAttribute(to); if (outputDspPort != null && inputDspPort != null) { using (var block = DSPGraph.CreateCommandBlock()) { block.Connect(((DSPNodeWidget)from.node).DSPNode, outputDspPort.portIndex, ((DSPNodeWidget)to.node).DSPNode, inputDspPort.portIndex); } } } }
void Update() { if (_Initialized == false) { return; } if (!_Waiting) { using (DSPCommandBlock block = _Graph.CreateCommandBlock()) { _Waiting = true; block.CreateUpdateRequest <SpectrumUpdateKernel, SpectrumNode.Parameters, SpectrumNode.Providers, SpectrumNode>(new SpectrumUpdateKernel(_Buffer), _ScopeNode, req => { UpdateRequestFinished(req); req.Dispose(); }); } } }
void Start() { var format = ChannelEnumConverter.GetSoundFormatFromSpeakerMode(AudioSettings.speakerMode); var channels = ChannelEnumConverter.GetChannelCountFromSoundFormat(format); AudioSettings.GetDSPBufferSize(out var bufferLength, out var numBuffers); var sampleRate = AudioSettings.outputSampleRate; m_Graph = DSPGraph.Create(format, channels, bufferLength, sampleRate); var driver = new DefaultDSPGraphDriver { Graph = m_Graph }; m_Output = driver.AttachToDefaultOutput(); // Add an event handler delegate to the graph for ClipStopped. So we are notified // of when a clip is stopped in the node and can handle the resources on the main thread. m_HandlerID = m_Graph.AddNodeEventHandler <ClipStopped>((node, evt) => { Debug.Log("Received ClipStopped event on main thread, cleaning resources"); }); // All async interaction with the graph must be done through a DSPCommandBlock. // Create it here and complete it once all commands are added. var block = m_Graph.CreateCommandBlock(); m_Node = block.CreateDSPNode <PlayClipNode.Parameters, PlayClipNode.SampleProviders, PlayClipNode>(); // Currently input and output ports are dynamic and added via this API to a node. // This will change to a static definition of nodes in the future. block.AddOutletPort(m_Node, 2, SoundFormat.Stereo); // Connect the node to the root of the graph. m_Connection = block.Connect(m_Node, 0, m_Graph.RootDSP, 0); // We are done, fire off the command block atomically to the mixer thread. block.Complete(); }
public override void Init() { base.Init(); if (DSPReady) { using (var block = DSPGraph.CreateCommandBlock()) { _DSPNode = block.CreateDSPNode <TParameters, TProviders, TAudioKernel>(); // gather possible inlets and outlets List <DSPPortAttribute> inlets = new List <DSPPortAttribute>(); List <DSPPortAttribute> outlets = new List <DSPPortAttribute>(); { var fields = NodeDataCache.GetNodeFields(GetType()); foreach (var field in fields) { var attributes = field.GetCustomAttributes(false).ToList(); var dspPort = attributes.Find(x => x is DSPPortAttribute) as DSPPortAttribute; if (dspPort != null) { if (attributes.Find(x => x is InputAttribute) != null) { inlets.Add(dspPort); } else if (attributes.Find(x => x is OutputAttribute) != null) { outlets.Add(dspPort); } } } } // sort by index inlets.Sort((l, r) => { return(l.portIndex - r.portIndex); }); outlets.Sort((l, r) => { return(l.portIndex - r.portIndex); }); #if UNITY_ASSERTIONS // validate for (int i = 0; i < inlets.Count; ++i) { Debug.Assert(inlets[i].portIndex == i); } for (int i = 0; i < outlets.Count; ++i) { Debug.Assert(outlets[i].portIndex == i); } #endif // add inlets and outlets foreach (var inlet in inlets) { block.AddInletPort(_DSPNode, inlet.channels, inlet.format); } foreach (var outlet in outlets) { block.AddOutletPort(_DSPNode, outlet.channels, outlet.format); } AddUpdateParametersToBlock(block); } } }
protected override void OnCreate() { //Initialize containers first m_mixNodePortFreelist = new NativeList <int>(Allocator.Persistent); m_mixNodePortCount = new NativeReference <int>(Allocator.Persistent); m_ildNodePortCount = new NativeReference <int>(Allocator.Persistent); m_packedFrameCounterBufferId = new NativeReference <long>(Allocator.Persistent); m_audioFrame = new NativeReference <int>(Allocator.Persistent); m_lastReadBufferId = new NativeReference <int>(Allocator.Persistent); m_buffersInFlight = new List <ManagedIldBuffer>(); worldBlackboardEntity.AddComponentDataIfMissing(new AudioSettings { audioFramesPerUpdate = 3, audioSubframesPerFrame = 1, logWarningIfBuffersAreStarved = false }); //Create graph and driver var format = ChannelEnumConverter.GetSoundFormatFromSpeakerMode(UnityEngine.AudioSettings.speakerMode); var channels = ChannelEnumConverter.GetChannelCountFromSoundFormat(format); UnityEngine.AudioSettings.GetDSPBufferSize(out m_samplesPerSubframe, out _); m_sampleRate = UnityEngine.AudioSettings.outputSampleRate; m_graph = DSPGraph.Create(format, channels, m_samplesPerSubframe, m_sampleRate); m_driver = new LatiosDSPGraphDriver { Graph = m_graph }; m_outputHandle = m_driver.AttachToDefaultOutput(); var commandBlock = m_graph.CreateCommandBlock(); m_mixNode = commandBlock.CreateDSPNode <MixStereoPortsNode.Parameters, MixStereoPortsNode.SampleProviders, MixStereoPortsNode>(); commandBlock.AddOutletPort(m_mixNode, 2); m_mixToOutputConnection = commandBlock.Connect(m_mixNode, 0, m_graph.RootDSP, 0); m_ildNode = commandBlock.CreateDSPNode <ReadIldBuffersNode.Parameters, ReadIldBuffersNode.SampleProviders, ReadIldBuffersNode>(); unsafe { commandBlock.UpdateAudioKernel <SetReadIldBuffersNodePackedFrameBufferId, ReadIldBuffersNode.Parameters, ReadIldBuffersNode.SampleProviders, ReadIldBuffersNode>( new SetReadIldBuffersNodePackedFrameBufferId { ptr = (long *)m_packedFrameCounterBufferId.GetUnsafePtr() }, m_ildNode); } commandBlock.Complete(); //Create queries m_aliveListenersQuery = Fluent.WithAll <AudioListener>(true).Build(); m_deadListenersQuery = Fluent.Without <AudioListener>().WithAll <ListenerGraphState>().Build(); m_oneshotsToDestroyWhenFinishedQuery = Fluent.WithAll <AudioSourceOneShot>().WithAll <AudioSourceDestroyOneShotWhenFinished>(true).Build(); m_oneshotsQuery = Fluent.WithAll <AudioSourceOneShot>().Build(); m_loopedQuery = Fluent.WithAll <AudioSourceLooped>().Build(); //Force initialization of Burst commandBlock = m_graph.CreateCommandBlock(); var dummyNode = commandBlock.CreateDSPNode <MixPortsToStereoNode.Parameters, MixPortsToStereoNode.SampleProviders, MixPortsToStereoNode>(); StateVariableFilterNode.Create(commandBlock, StateVariableFilterNode.FilterType.Bandpass, 0f, 0f, 0f, 1); commandBlock.UpdateAudioKernel <MixPortsToStereoNodeUpdate, MixPortsToStereoNode.Parameters, MixPortsToStereoNode.SampleProviders, MixPortsToStereoNode>( new MixPortsToStereoNodeUpdate { leftChannelCount = 0 }, dummyNode); commandBlock.UpdateAudioKernel <ReadIldBuffersNodeUpdate, ReadIldBuffersNode.Parameters, ReadIldBuffersNode.SampleProviders, ReadIldBuffersNode>(new ReadIldBuffersNodeUpdate { ildBuffer = new IldBuffer(), }, m_ildNode); commandBlock.Cancel(); }
public void Dispose() { using (var block = Graph.CreateCommandBlock()) block.ReleaseDSPNode(Node); Graph.Dispose(); }
void ConfigureDSP() { AudioConfiguration audioConfig = AudioSettings.GetConfiguration(); Debug.LogFormat("BufferSize={0} SampleRate={1}", audioConfig.dspBufferSize, audioConfig.sampleRate); _MicrophoneClip = Microphone.Start(Microphone.devices[0], true, 1, audioConfig.sampleRate); Debug.LogFormat("Microphone Channels={0} Frequency={1} Samples={2} Ambisonic={3}", _MicrophoneClip.channels, _MicrophoneClip.frequency, _MicrophoneClip.samples, _MicrophoneClip.ambisonic); _MicrophoneBuffer = new NativeArray <float>(_MicrophoneClip.samples, Allocator.Persistent, NativeArrayOptions.UninitializedMemory); _MicrophoneDataArray = new float[_MicrophoneClip.samples]; _Graph = DSPGraph.Create(SoundFormat.Stereo, 2, audioConfig.dspBufferSize, audioConfig.sampleRate); _Driver = new MyAudioDriver { Graph = _Graph }; _OutputHandle = _Driver.AttachToDefaultOutput(); // create graph structure using (var block = _Graph.CreateCommandBlock()) { // // create nodes // _Microphone = block.CreateDSPNode <MicrophoneNode.Parameters, MicrophoneNode.Providers, MicrophoneNode>(); block.AddOutletPort(_Microphone, 1, SoundFormat.Mono); _Scope = block.CreateDSPNode <ScopeNode.Parameters, ScopeNode.Providers, ScopeNode>(); block.AddInletPort(_Scope, 1, SoundFormat.Mono); _Spectrum = block.CreateDSPNode <SpectrumNode.Parameters, SpectrumNode.Providers, SpectrumNode>(); block.AddInletPort(_Spectrum, 1, SoundFormat.Mono); _MonoToStereo = block.CreateDSPNode <MonoToStereoNode.Parameters, MonoToStereoNode.Providers, MonoToStereoNode>(); block.AddInletPort(_MonoToStereo, 1, SoundFormat.Mono); // left block.AddInletPort(_MonoToStereo, 1, SoundFormat.Mono); // right block.AddOutletPort(_MonoToStereo, 2, SoundFormat.Stereo); // // connect nodes // block.Connect(_Microphone, 0, _MonoToStereo, 0); block.Connect(_Microphone, 0, _MonoToStereo, 1); block.Connect(_MonoToStereo, 0, _Graph.RootDSP, 0); block.Connect(_Microphone, 0, _Scope, 0); block.Connect(_Microphone, 0, _Spectrum, 0); // // set parameters // block.SetFloat <ScopeNode.Parameters, ScopeNode.Providers, ScopeNode>(_Scope, ScopeNode.Parameters.Time, 1f); block.SetFloat <ScopeNode.Parameters, ScopeNode.Providers, ScopeNode>(_Scope, ScopeNode.Parameters.TriggerTreshold, 0f); block.SetFloat <SpectrumNode.Parameters, SpectrumNode.Providers, SpectrumNode>(_Spectrum, SpectrumNode.Parameters.Window, (float)SpectrumNode.WindowType.Hamming); } _ScopeRenderer = SpawnScopeRenderer(_Scope); _ScopeRenderer.Height = 5.0f; _ScopeRenderer.Offset = 0.0f; _SpectrumRenderer = SpawnSpectrumRenderer(_Spectrum); StartCoroutine(InitMicCoroutine()); }
void ConfigureDSP() { AudioConfiguration audioConfig = AudioSettings.GetConfiguration(); Debug.LogFormat("BufferSize={0} SampleRate={1}", audioConfig.dspBufferSize, audioConfig.sampleRate); _Graph = DSPGraph.Create(SoundFormat.Stereo, 2, audioConfig.dspBufferSize, audioConfig.sampleRate); _Driver = new MyAudioDriver { Graph = _Graph }; _OutputHandle = _Driver.AttachToDefaultOutput(); // create graph structure using (var block = _Graph.CreateCommandBlock()) { // // create nodes // _Oscilator1 = CreateOscilator(block); _Oscilator2 = CreateOscilator(block); _Oscilator3 = CreateOscilator(block); _Oscilator4 = CreateOscilator(block); _ADSR1 = CreateADSR(block); _ADSR2 = CreateADSR(block); _ADSR3 = CreateADSR(block); _ADSR4 = CreateADSR(block); _VCA1 = CreateVCA(block); _VCA2 = CreateVCA(block); _Mixer3 = CreateMixer(block); _Mixer4 = CreateMixer(block); _Midi = CreateMidi(block); _Attenuator = CreateAttenuator(block); _MonoToStereo = CreateMonoToStereo(block); _Scope = CreateMonoScope(block); _Spectrum = CreateSpectrum(block); // // connect nodes // block.Connect(_Midi, 0, _ADSR1, 0); // midi gate to adsr block.Connect(_Midi, 0, _ADSR2, 0); block.Connect(_Midi, 0, _ADSR3, 0); block.Connect(_Midi, 0, _ADSR4, 0); block.Connect(_Midi, 1, _Oscilator1, 1); // midi note to oscilator pitch block.Connect(_Midi, 1, _Oscilator2, 1); block.Connect(_Midi, 1, _Oscilator3, 1); block.Connect(_Midi, 1, _Oscilator4, 1); block.Connect(_Midi, 2, _Oscilator1, 2); // midi retrigger to oscilator reset phase block.Connect(_Midi, 2, _Oscilator2, 2); block.Connect(_Midi, 2, _Oscilator3, 2); block.Connect(_Midi, 2, _Oscilator4, 2); block.Connect(_ADSR1, 0, _VCA1, 0); // adsr gate to vca voltage block.Connect(_ADSR2, 0, _VCA2, 0); block.Connect(_Oscilator1, 0, _VCA1, 1); // oscilator out to vca in block.Connect(_Oscilator2, 0, _VCA2, 1); block.Connect(_VCA1, 0, _Oscilator3, 0); // vca out to oscilator fm block.Connect(_VCA2, 0, _Oscilator4, 0); block.Connect(_ADSR3, 0, _Mixer3, 1); // adsr gate to mixer cv block.Connect(_ADSR4, 0, _Mixer4, 1); block.Connect(_Oscilator3, 0, _Mixer3, 0); // oscilator out to mixer in block.Connect(_Oscilator4, 0, _Mixer4, 0); block.Connect(_Mixer3, 0, _Attenuator, 0); // mixer out to attenuator in block.Connect(_Mixer4, 0, _Attenuator, 0); block.Connect(_Attenuator, 0, _MonoToStereo, 0); // attenuator out to monotostereo left block.Connect(_Attenuator, 0, _MonoToStereo, 1); // attenuator out to monotostereo right block.Connect(_MonoToStereo, 0, _Graph.RootDSP, 0); // monotostereo out to output block.Connect(_Attenuator, 0, _Scope, 0); block.Connect(_Attenuator, 0, _Spectrum, 0); // // parameters // block.SetFloat <OscilatorNode.Parameters, OscilatorNode.Providers, OscilatorNode>(_Oscilator1, OscilatorNode.Parameters.Frequency, 130.813f); block.SetFloat <OscilatorNode.Parameters, OscilatorNode.Providers, OscilatorNode>(_Oscilator1, OscilatorNode.Parameters.Mode, (float)OscilatorNode.Mode.Sine); block.SetFloat <OscilatorNode.Parameters, OscilatorNode.Providers, OscilatorNode>(_Oscilator2, OscilatorNode.Parameters.Frequency, 130.813f); block.SetFloat <OscilatorNode.Parameters, OscilatorNode.Providers, OscilatorNode>(_Oscilator2, OscilatorNode.Parameters.Mode, (float)OscilatorNode.Mode.Sine); block.SetFloat <OscilatorNode.Parameters, OscilatorNode.Providers, OscilatorNode>(_Oscilator3, OscilatorNode.Parameters.Frequency, 261.626f); block.SetFloat <OscilatorNode.Parameters, OscilatorNode.Providers, OscilatorNode>(_Oscilator3, OscilatorNode.Parameters.Mode, (float)OscilatorNode.Mode.Sine); block.SetFloat <OscilatorNode.Parameters, OscilatorNode.Providers, OscilatorNode>(_Oscilator3, OscilatorNode.Parameters.FMMultiplier, 0.5f); block.SetFloat <OscilatorNode.Parameters, OscilatorNode.Providers, OscilatorNode>(_Oscilator4, OscilatorNode.Parameters.Frequency, 130.813f); block.SetFloat <OscilatorNode.Parameters, OscilatorNode.Providers, OscilatorNode>(_Oscilator4, OscilatorNode.Parameters.Mode, (float)OscilatorNode.Mode.Sine); block.SetFloat <OscilatorNode.Parameters, OscilatorNode.Providers, OscilatorNode>(_Oscilator4, OscilatorNode.Parameters.FMMultiplier, 0.4f); block.SetFloat <ADSRNode.Parameters, ADSRNode.Providers, ADSRNode>(_ADSR1, ADSRNode.Parameters.Attack, 0.1f); block.SetFloat <ADSRNode.Parameters, ADSRNode.Providers, ADSRNode>(_ADSR1, ADSRNode.Parameters.Decay, 0.05f); block.SetFloat <ADSRNode.Parameters, ADSRNode.Providers, ADSRNode>(_ADSR1, ADSRNode.Parameters.Sustain, 0.5f); block.SetFloat <ADSRNode.Parameters, ADSRNode.Providers, ADSRNode>(_ADSR1, ADSRNode.Parameters.Release, 0.2f); block.SetFloat <ADSRNode.Parameters, ADSRNode.Providers, ADSRNode>(_ADSR2, ADSRNode.Parameters.Attack, 0.1f); block.SetFloat <ADSRNode.Parameters, ADSRNode.Providers, ADSRNode>(_ADSR2, ADSRNode.Parameters.Decay, 0.05f); block.SetFloat <ADSRNode.Parameters, ADSRNode.Providers, ADSRNode>(_ADSR2, ADSRNode.Parameters.Sustain, 0.5f); block.SetFloat <ADSRNode.Parameters, ADSRNode.Providers, ADSRNode>(_ADSR2, ADSRNode.Parameters.Release, 0.2f); block.SetFloat <ADSRNode.Parameters, ADSRNode.Providers, ADSRNode>(_ADSR3, ADSRNode.Parameters.Attack, 0.05f); block.SetFloat <ADSRNode.Parameters, ADSRNode.Providers, ADSRNode>(_ADSR3, ADSRNode.Parameters.Decay, 0.05f); block.SetFloat <ADSRNode.Parameters, ADSRNode.Providers, ADSRNode>(_ADSR3, ADSRNode.Parameters.Sustain, 0.5f); block.SetFloat <ADSRNode.Parameters, ADSRNode.Providers, ADSRNode>(_ADSR3, ADSRNode.Parameters.Release, 0.1f); block.SetFloat <ADSRNode.Parameters, ADSRNode.Providers, ADSRNode>(_ADSR4, ADSRNode.Parameters.Attack, 0.05f); block.SetFloat <ADSRNode.Parameters, ADSRNode.Providers, ADSRNode>(_ADSR4, ADSRNode.Parameters.Decay, 0.05f); block.SetFloat <ADSRNode.Parameters, ADSRNode.Providers, ADSRNode>(_ADSR4, ADSRNode.Parameters.Sustain, 0.5f); block.SetFloat <ADSRNode.Parameters, ADSRNode.Providers, ADSRNode>(_ADSR4, ADSRNode.Parameters.Release, 0.1f); block.SetFloat <VCANode.Parameters, VCANode.Providers, VCANode>(_VCA1, VCANode.Parameters.Multiplier, 1.0f); block.SetFloat <VCANode.Parameters, VCANode.Providers, VCANode>(_VCA2, VCANode.Parameters.Multiplier, 1.0f); block.SetFloat <AttenuatorNode.Parameters, AttenuatorNode.Providers, AttenuatorNode>(_Attenuator, AttenuatorNode.Parameters.Multiplier, 1.0f); block.SetFloat <ScopeNode.Parameters, ScopeNode.Providers, ScopeNode>(_Scope, ScopeNode.Parameters.Time, 0.05f); block.SetFloat <ScopeNode.Parameters, ScopeNode.Providers, ScopeNode>(_Scope, ScopeNode.Parameters.TriggerTreshold, 0f); block.SetFloat <SpectrumNode.Parameters, SpectrumNode.Providers, SpectrumNode>(_Spectrum, SpectrumNode.Parameters.Window, (float)SpectrumNode.WindowType.BlackmanHarris); } _ScopeRenderer = SpawnScopeRenderer(_Scope); _ScopeRenderer.Height = 5.01f; _ScopeRenderer.Offset = 0f; _SpectrumRenderer = SpawnSpectrumRenderer(_Spectrum); }
public NodeData CreateGeneratorNode(DSPNode consumer, int channelCount = DefaultChannelCount, SoundFormat soundFormat = DefaultSoundFormat) { using (var block = Graph.CreateCommandBlock()) return(CreateGeneratorNode(block, consumer, channelCount, soundFormat)); }