ipytone icon indicating copy to clipboard operation
ipytone copied to clipboard

High-level vs. low-level audio graph

Open benbovy opened this issue 3 years ago • 1 comments

It would be nice to have a high-level representation of the graph of audio nodes that doesn't contain all the internal nodes (and their connections) defined within the audio nodes.

  • API

By default, all new connections are considered as high-level. A context manager may help in temporarily disabling this behavior, e.g.,

class MyAudioNode(ipytone.PyAudioNode):

    def __init__(self, **kwargs):
        in_node = Gain()
        out_node = Gain()
        super().__init__(in_node, out_node, **kwargs)

        with self._graph.at_low_level():
            # all connections here will be at low-level
            in_node.connect(out_node)
  • Implementation

For example, add a tag low_level=True to audio graph connections.

benbovy avatar May 11 '22 15:05 benbovy

Or use internal instead of low_level...

benbovy avatar May 11 '22 16:05 benbovy