in the show_editor() Example it should be thread.start() not thread.run().
The Example:
import pedalboard
from threading import Event, Thread
plugin = pedalboard.load_plugin("../path-to-my-plugin-file")
close_window_event = Event()
def other_thread():
# do something to determine when to close the window
if should_close_window:
close_window_event.set()
thread = Thread(target=other_thread)
thread.run()
# This will block until the other thread calls .set():
plugin.show_editor(close_window_event)
Corrected:
import pedalboard
from threading import Event, Thread
plugin = pedalboard.load_plugin("../path-to-my-plugin-file")
close_window_event = Event()
def other_thread():
# do something to determine when to close the window
if should_close_window:
close_window_event.set()
thread = Thread(target=other_thread)
thread.start()
# This will block until the other thread calls .set():
plugin.show_editor(close_window_event)
The run() method is the entry point for the thread's activity, but calling it directly won't start the thread in a separate execution context.
On page
https://spotify.github.io/pedalboard/reference/pedalboard.html#pedalboard.AudioUnitPlugin.show_editor
in the
show_editor()
Example it should bethread.start()
notthread.run()
.The Example:
Corrected:
The
run()
method is the entry point for the thread's activity, but calling it directly won't start the thread in a separate execution context.