diff --git a/tests/test_node.py b/tests/test_node.py index 74b8a0cd..2bbf3351 100644 --- a/tests/test_node.py +++ b/tests/test_node.py @@ -1,4 +1,4 @@ -from signalflow import SineOscillator, AudioGraph, Line, SIGNALFLOW_NODE_INITIAL_OUTPUT_BUFFERS +from signalflow import SineOscillator, AudioGraph, Line, SIGNALFLOW_NODE_INITIAL_OUTPUT_CHANNELS from signalflow import NodeAlreadyPlayingException, NodeNotPlayingException import signalflow as sf import numpy as np @@ -14,7 +14,7 @@ def test_node_no_graph(): def test_node_process(graph): a = SineOscillator(440) a.process(1024) - assert a.output_buffer.shape == (SIGNALFLOW_NODE_INITIAL_OUTPUT_BUFFERS, 1024) + assert a.output_buffer.shape == (SIGNALFLOW_NODE_INITIAL_OUTPUT_CHANNELS, 1024) def test_node_add_input(graph): @@ -77,13 +77,13 @@ def test_node_write_to_output_buffer(graph): a.output_buffer[0][3] = 1.0 assert a.output_buffer[0][3] == 1.0 - assert a.output_buffer.shape == (SIGNALFLOW_NODE_INITIAL_OUTPUT_BUFFERS, graph.output_buffer_size) - a.output_buffer[SIGNALFLOW_NODE_INITIAL_OUTPUT_BUFFERS - 1][-1] = 1.0 - assert a.output_buffer[SIGNALFLOW_NODE_INITIAL_OUTPUT_BUFFERS - 1][-1] == 1.0 + assert a.output_buffer.shape == (SIGNALFLOW_NODE_INITIAL_OUTPUT_CHANNELS, graph.output_buffer_size) + a.output_buffer[SIGNALFLOW_NODE_INITIAL_OUTPUT_CHANNELS - 1][-1] = 1.0 + assert a.output_buffer[SIGNALFLOW_NODE_INITIAL_OUTPUT_CHANNELS - 1][-1] == 1.0 with pytest.raises(IndexError): - a.output_buffer[SIGNALFLOW_NODE_INITIAL_OUTPUT_BUFFERS][graph.output_buffer_size - 1] == 1.0 + a.output_buffer[SIGNALFLOW_NODE_INITIAL_OUTPUT_CHANNELS][graph.output_buffer_size - 1] == 1.0 with pytest.raises(IndexError): - a.output_buffer[SIGNALFLOW_NODE_INITIAL_OUTPUT_BUFFERS][graph.output_buffer_size] == 1.0 + a.output_buffer[SIGNALFLOW_NODE_INITIAL_OUTPUT_CHANNELS][graph.output_buffer_size] == 1.0 def test_node_trigger(graph): diff --git a/tests/test_node_multichannel_expansion.py b/tests/test_node_multichannel_expansion.py index 9871b010..b8c07000 100644 --- a/tests/test_node_multichannel_expansion.py +++ b/tests/test_node_multichannel_expansion.py @@ -1,5 +1,5 @@ from signalflow import SineOscillator, SquareOscillator, ChannelMixer, ChannelArray, StereoPanner, Buffer, BufferPlayer, \ - AudioGraph, AudioOut_Dummy, SIGNALFLOW_NODE_INITIAL_OUTPUT_BUFFERS + AudioGraph, AudioOut_Dummy, SIGNALFLOW_NODE_INITIAL_OUTPUT_CHANNELS from signalflow import BiquadFilter, AllpassDelay, WaveShaper, WaveShaperBuffer, Constant, Add, AudioGraphConfig from signalflow import InvalidChannelCountException import numpy as np @@ -179,7 +179,7 @@ def test_expansion_recursive_processing(graph): def test_expansion_buffer_reallocation(graph): a = SineOscillator([440] * 4) assert a.num_output_channels == 4 - assert a.num_output_channels_allocated == max(4, SIGNALFLOW_NODE_INITIAL_OUTPUT_BUFFERS) + assert a.num_output_channels_allocated == max(4, SIGNALFLOW_NODE_INITIAL_OUTPUT_CHANNELS) a.set_input("frequency", [440] * 100) assert a.num_output_channels == 100 assert a.num_output_channels_allocated == 100 @@ -190,7 +190,7 @@ def test_expansion_input_reallocation(graph): Need to allocate more output buffers for upmixing rename num_output_channels_allocated to num_allocated_output_buffers """ - channel_count = SIGNALFLOW_NODE_INITIAL_OUTPUT_BUFFERS + 1 + channel_count = SIGNALFLOW_NODE_INITIAL_OUTPUT_CHANNELS + 1 a = Constant(4) b = Add(a, [9] * channel_count) assert b.num_output_channels == channel_count