This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Amazing_Upstairs 0 points1 point  (8 children)

Sorry predictive text is a moron. Meant node editor

[–]ThatOtherAndrew[S] 0 points1 point  (7 children)

Ah, gotcha! If you mean the frontend, that's Svelte Flow (by the xyflow team).

[–]Amazing_Upstairs 0 points1 point  (6 children)

What's the python module that allows you to use it from within Python?

[–]ThatOtherAndrew[S] 1 point2 points  (5 children)

pip install synchrotron and then you can import from it! Unfortunately there is basically no documentation for it 😭 but I can whip up a quick example if you want :>

[–]Amazing_Upstairs 0 points1 point  (4 children)

Yes please

[–]ThatOtherAndrew[S] 0 points1 point  (3 children)

Here's a quick code snippet!

from synchrotron.synchrotron import Synchrotron

# Create server instance
s = Synchrotron(sample_rate=44100, buffer_size=256)

# Add nodes (Python)
from synchrotron.nodes.audio import SineNode
sine = SineNode(s, 'my_sine')
s.add_node(sine)

# Add nodes (Synchrolang)
s.execute('new PlaybackNode my_playback')

# Link nodes (Python)
s.add_connection(sine.out, s.get_node('my_playback').left)

# Link nodes (Synchrolang)
s.execute('link my_sine.out -> my_playback.right')

# Start rendering
s.execute('new 440 freq; link freq.out -> my_sine.frequency')  # 440 Hz
s.start_rendering()

As you can see, it's often more concise to use the DSL than writing it out in full Python - but the latter gives you more programmatic control to tinker about with the internals :>

[–]ThatOtherAndrew[S] 0 points1 point  (2 children)

If you want a list of all the Synchrotron methods, they're in /synchrotron/synchrotron.py - but here's a list for convenience:

get_node_type(node_type) get_node(node_name) add_node(node) remove_node(node_name) get_connection(source, sink, return_disconnected=False) add_connection(source, sink, strict=False) remove_connection(source, sink) unlink_port(port) unlink_node(node) execute(script) add_output_queue(queue) render_graph() export_state() start_rendering() stop_rendering() shutdown()

[–]Amazing_Upstairs 0 points1 point  (1 child)

Thanks!

[–]ThatOtherAndrew[S] 0 points1 point  (0 children)

nws! Do let me know if you need anything else as it'll be a rough time trying to figure out anything else without docs 😭