Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.7KB

  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. # --------------------------------------------------------------------------------------------------------
  4. from carla_backend import *
  5. from signal import signal, SIGINT, SIGTERM
  6. from time import sleep
  7. from sys import exit
  8. # --------------------------------------------------------------------------------------------------------
  9. class CarlaObject(object):
  10. __slots__ = [
  11. 'term'
  12. ]
  13. gCarla = CarlaObject()
  14. gCarla.term = False
  15. def signalHandler(sig, frame):
  16. if sig in (SIGINT, SIGTERM):
  17. gCarla.term = True
  18. # --------------------------------------------------------------------------------------------------------
  19. binaryDir = "/home/falktx/Personal/FOSS/GIT/falkTX/Carla/bin"
  20. host = CarlaHostDLL("/home/falktx/FOSS/GIT-mine/falkTX/Carla/bin/libcarla_standalone2.so", False)
  21. host.set_engine_option(ENGINE_OPTION_PATH_BINARIES, 0, binaryDir)
  22. if not host.engine_init("JACK", "Carla-uhe-test"):
  23. print("Engine failed to initialize, possible reasons:\n%s" % host.get_last_error())
  24. exit(1)
  25. if not host.add_plugin(BINARY_NATIVE, PLUGIN_VST2, "/home/falktx/.vst/u-he/ACE.64.so", "", "", 0, None, 0):
  26. print("Failed to load plugin, possible reasons:\n%s" % host.get_last_error())
  27. host.engine_close()
  28. exit(1)
  29. signal(SIGINT, signalHandler)
  30. signal(SIGTERM, signalHandler)
  31. while host.is_engine_running() and not gCarla.term:
  32. host.engine_idle()
  33. sleep(0.5)
  34. if not gCarla.term:
  35. print("Engine closed abruptely")
  36. if not host.engine_close():
  37. print("Engine failed to close, possible reasons:\n%s" % host.get_last_error())
  38. exit(1)
  39. # --------------------------------------------------------------------------------------------------------