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.

1912 lines
60KB

  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. # Carla Backend code
  4. # Copyright (C) 2011-2013 Filipe Coelho <falktx@falktx.com>
  5. #
  6. # This program is free software; you can redistribute it and/or
  7. # modify it under the terms of the GNU General Public License as
  8. # published by the Free Software Foundation; either version 2 of
  9. # the License, or any later version.
  10. #
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. # GNU General Public License for more details.
  15. #
  16. # For a full copy of the GNU General Public License see the doc/GPL.txt file.
  17. # ------------------------------------------------------------------------------------------------------------
  18. # Imports (Global)
  19. from ctypes import *
  20. from platform import architecture
  21. from sys import platform, maxsize
  22. # ------------------------------------------------------------------------------------------------------------
  23. # 64bit check
  24. kIs64bit = bool(architecture()[0] == "64bit" and maxsize > 2**32)
  25. # ------------------------------------------------------------------------------------------------------------
  26. # Define enum type (integer)
  27. c_enum = c_int
  28. # ------------------------------------------------------------------------------------------------------------
  29. # Set Platform
  30. if platform == "darwin":
  31. HAIKU = False
  32. LINUX = False
  33. MACOS = True
  34. WINDOWS = False
  35. elif "haiku" in platform:
  36. HAIKU = True
  37. LINUX = False
  38. MACOS = False
  39. WINDOWS = False
  40. elif "linux" in platform:
  41. HAIKU = False
  42. LINUX = True
  43. MACOS = False
  44. WINDOWS = False
  45. elif platform in ("win32", "win64", "cygwin"):
  46. HAIKU = False
  47. LINUX = False
  48. MACOS = False
  49. WINDOWS = True
  50. else:
  51. HAIKU = False
  52. LINUX = False
  53. MACOS = False
  54. WINDOWS = False
  55. # ------------------------------------------------------------------------------------------------------------
  56. # Convert a ctypes c_char_p into a python string
  57. def charPtrToString(value):
  58. if not value:
  59. return ""
  60. if isinstance(value, str):
  61. return value
  62. return value.decode("utf-8", errors="ignore")
  63. # ------------------------------------------------------------------------------------------------------------
  64. # Convert a ctypes POINTER(c_char_p) into a python string list
  65. def charPtrPtrToStringList(charPtrPtr):
  66. if not charPtrPtr:
  67. return []
  68. i = 0
  69. charPtr = charPtrPtr[0]
  70. strList = []
  71. while charPtr:
  72. strList.append(charPtr.decode("utf-8", errors="ignore"))
  73. i += 1
  74. charPtr = charPtrPtr[i]
  75. return strList
  76. # ------------------------------------------------------------------------------------------------------------
  77. # Convert a ctypes POINTER(c_<num>) into a python number list
  78. def numPtrToList(numPtr):
  79. if not numPtr:
  80. return []
  81. i = 0
  82. num = numPtr[0].value
  83. numList = []
  84. while num not in (0, 0.0):
  85. numList.append(num)
  86. i += 1
  87. num = numPtr[i].value
  88. return numList
  89. # ------------------------------------------------------------------------------------------------------------
  90. # Convert a ctypes struct into a python dict
  91. def structToDict(struct):
  92. return dict((attr, getattr(struct, attr)) for attr, value in struct._fields_)
  93. # ------------------------------------------------------------------------------------------------------------
  94. # Carla Backend API (base definitions)
  95. # Maximum default number of loadable plugins.
  96. MAX_DEFAULT_PLUGINS = 99
  97. # Maximum number of loadable plugins in rack mode.
  98. MAX_RACK_PLUGINS = 16
  99. # Maximum number of loadable plugins in patchbay mode.
  100. MAX_PATCHBAY_PLUGINS = 255
  101. # Maximum default number of parameters allowed.
  102. # @see ENGINE_OPTION_MAX_PARAMETERS
  103. MAX_DEFAULT_PARAMETERS = 200
  104. # ------------------------------------------------------------------------------------------------------------
  105. # Engine Driver Device Hints
  106. # Various engine driver device hints.
  107. # @see carla_get_engine_driver_device_info()
  108. # Engine driver device has custom control-panel.
  109. ENGINE_DRIVER_DEVICE_HAS_CONTROL_PANEL = 0x1
  110. # Engine driver device can change buffer-size on the fly.
  111. # @see ENGINE_OPTION_AUDIO_BUFFER_SIZE
  112. ENGINE_DRIVER_DEVICE_VARIABLE_BUFFER_SIZE = 0x2
  113. # Engine driver device can change sample-rate on the fly.
  114. # @see ENGINE_OPTION_AUDIO_SAMPLE_RATE
  115. ENGINE_DRIVER_DEVICE_VARIABLE_SAMPLE_RATE = 0x4
  116. # ------------------------------------------------------------------------------------------------------------
  117. # Plugin Hints
  118. # Various plugin hints.
  119. # @see carla_get_plugin_info()
  120. # Plugin is a bridge.
  121. # This hint is required because "bridge" itself is not a plugin type.
  122. PLUGIN_IS_BRIDGE = 0x001
  123. # Plugin is hard real-time safe.
  124. PLUGIN_IS_RTSAFE = 0x002
  125. # Plugin is a synth (produces sound).
  126. PLUGIN_IS_SYNTH = 0x004
  127. # Plugin has its own custom UI.
  128. # @see carla_show_custom_ui()
  129. PLUGIN_HAS_CUSTOM_UI = 0x008
  130. # Plugin can use internal Dry/Wet control.
  131. PLUGIN_CAN_DRYWET = 0x010
  132. # Plugin can use internal Volume control.
  133. PLUGIN_CAN_VOLUME = 0x020
  134. # Plugin can use internal (Stereo) Balance controls.
  135. PLUGIN_CAN_BALANCE = 0x040
  136. # Plugin can use internal (Mono) Panning control.
  137. PLUGIN_CAN_PANNING = 0x080
  138. # Plugin needs a constant, fixed-size audio buffer.
  139. PLUGIN_NEEDS_FIXED_BUFFERS = 0x100
  140. # Plugin needs all UI events in a single/main thread.
  141. PLUGIN_NEEDS_SINGLE_THREAD = 0x200
  142. # ------------------------------------------------------------------------------------------------------------
  143. # Plugin Options
  144. # Various plugin options.
  145. # @see carla_get_plugin_info() and carla_set_option()
  146. # Use constant/fixed-size audio buffers.
  147. PLUGIN_OPTION_FIXED_BUFFERS = 0x001
  148. # Force mono plugin as stereo.
  149. PLUGIN_OPTION_FORCE_STEREO = 0x002
  150. # Map MIDI programs to plugin programs.
  151. PLUGIN_OPTION_MAP_PROGRAM_CHANGES = 0x004
  152. # Use chunks to save and restore data.
  153. PLUGIN_OPTION_USE_CHUNKS = 0x008
  154. # Send MIDI control change events.
  155. PLUGIN_OPTION_SEND_CONTROL_CHANGES = 0x010
  156. # Send MIDI channel pressure events.
  157. PLUGIN_OPTION_SEND_CHANNEL_PRESSURE = 0x020
  158. # Send MIDI note after-touch events.
  159. PLUGIN_OPTION_SEND_NOTE_AFTERTOUCH = 0x040
  160. # Send MIDI pitch-bend events.
  161. PLUGIN_OPTION_SEND_PITCHBEND = 0x080
  162. # Send MIDI all-sounds/notes-off events, single note-offs otherwise.
  163. PLUGIN_OPTION_SEND_ALL_SOUND_OFF = 0x100
  164. # ------------------------------------------------------------------------------------------------------------
  165. # Parameter Hints
  166. # Various parameter hints.
  167. # @see CarlaPlugin::getParameterData() and carla_get_parameter_data()
  168. # Parameter value is boolean.
  169. PARAMETER_IS_BOOLEAN = 0x001
  170. # Parameter value is integer.
  171. PARAMETER_IS_INTEGER = 0x002
  172. # Parameter value is logarithmic.
  173. PARAMETER_IS_LOGARITHMIC = 0x004
  174. # Parameter is enabled.
  175. # It can be viewed, changed and stored.
  176. PARAMETER_IS_ENABLED = 0x010
  177. # Parameter is automable (real-time safe).
  178. PARAMETER_IS_AUTOMABLE = 0x020
  179. # Parameter is read-only.
  180. # It cannot be changed.
  181. PARAMETER_IS_READ_ONLY = 0x040
  182. # Parameter needs sample rate to work.
  183. # Value and ranges are multiplied by sample rate on usage and divided by sample rate on save.
  184. PARAMETER_USES_SAMPLERATE = 0x100
  185. # Parameter uses scale points to define internal values in a meaningful way.
  186. PARAMETER_USES_SCALEPOINTS = 0x200
  187. # Parameter uses custom text for displaying its value.
  188. # @see carla_get_parameter_text()
  189. PARAMETER_USES_CUSTOM_TEXT = 0x400
  190. # ------------------------------------------------------------------------------------------------------------
  191. # Patchbay Port Hints
  192. # Various patchbay port hints.
  193. # Patchbay port is input.
  194. # When this hint is not set, port is assumed to be output.
  195. PATCHBAY_PORT_IS_INPUT = 0x1
  196. # Patchbay port is of Audio type.
  197. PATCHBAY_PORT_TYPE_AUDIO = 0x2
  198. # Patchbay port is of CV type (Control Voltage).
  199. PATCHBAY_PORT_TYPE_CV = 0x4
  200. # Patchbay port is of MIDI type.
  201. PATCHBAY_PORT_TYPE_MIDI = 0x8
  202. # ------------------------------------------------------------------------------------------------------------
  203. # Custom Data Types
  204. # These types define how the value in the CustomData struct is stored.
  205. # @see CustomData.type
  206. # Boolean string type URI.
  207. # Only "true" and "false" are valid values.
  208. CUSTOM_DATA_TYPE_BOOLEAN = "http://kxstudio.sf.net/ns/carla/boolean"
  209. # Chunk type URI.
  210. CUSTOM_DATA_TYPE_CHUNK = "http://kxstudio.sf.net/ns/carla/chunk"
  211. # String type URI.
  212. CUSTOM_DATA_TYPE_STRING = "http://kxstudio.sf.net/ns/carla/string"
  213. # ------------------------------------------------------------------------------------------------------------
  214. # Custom Data Keys
  215. # Pre-defined keys used internally in Carla.
  216. # @see CustomData.key
  217. # Plugin options key.
  218. CUSTOM_DATA_KEY_PLUGIN_OPTIONS = "CarlaPluginOptions"
  219. # UI position key.
  220. CUSTOM_DATA_KEY_UI_POSITION = "CarlaUiPosition"
  221. # UI size key.
  222. CUSTOM_DATA_KEY_UI_SIZE = "CarlaUiSize"
  223. # UI visible key.
  224. CUSTOM_DATA_KEY_UI_VISIBLE = "CarlaUiVisible"
  225. # ------------------------------------------------------------------------------------------------------------
  226. # Binary Type
  227. # The binary type of a plugin.
  228. # Null binary type.
  229. BINARY_NONE = 0
  230. # POSIX 32bit binary.
  231. BINARY_POSIX32 = 1
  232. # POSIX 64bit binary.
  233. BINARY_POSIX64 = 2
  234. # Windows 32bit binary.
  235. BINARY_WIN32 = 3
  236. # Windows 64bit binary.
  237. BINARY_WIN64 = 4
  238. # Other binary type.
  239. BINARY_OTHER = 5
  240. # ------------------------------------------------------------------------------------------------------------
  241. # Plugin Type
  242. # Plugin type.
  243. # Some files are handled as if they were plugins.
  244. # Null plugin type.
  245. PLUGIN_NONE = 0
  246. # Internal plugin.
  247. PLUGIN_INTERNAL = 1
  248. # LADSPA plugin.
  249. PLUGIN_LADSPA = 2
  250. # DSSI plugin.
  251. PLUGIN_DSSI = 3
  252. # LV2 plugin.
  253. PLUGIN_LV2 = 4
  254. # VST plugin.
  255. PLUGIN_VST = 5
  256. # AU plugin.
  257. # @note MacOS only
  258. PLUGIN_AU = 6
  259. # Csound file.
  260. PLUGIN_CSOUND = 7
  261. # GIG file.
  262. PLUGIN_GIG = 8
  263. # SF2 file (also known as SoundFont).
  264. PLUGIN_SF2 = 9
  265. # SFZ file.
  266. PLUGIN_SFZ = 10
  267. # ------------------------------------------------------------------------------------------------------------
  268. # Plugin Category
  269. # Plugin category, which describes the functionality of a plugin.
  270. # Null plugin category.
  271. PLUGIN_CATEGORY_NONE = 0
  272. # A synthesizer or generator.
  273. PLUGIN_CATEGORY_SYNTH = 1
  274. # A delay or reverb.
  275. PLUGIN_CATEGORY_DELAY = 2
  276. # An equalizer.
  277. PLUGIN_CATEGORY_EQ = 3
  278. # A filter.
  279. PLUGIN_CATEGORY_FILTER = 4
  280. # A distortion plugin.
  281. PLUGIN_CATEGORY_DISTORTION = 5
  282. # A 'dynamic' plugin (amplifier, compressor, gate, etc).
  283. PLUGIN_CATEGORY_DYNAMICS = 6
  284. # A 'modulator' plugin (chorus, flanger, phaser, etc).
  285. PLUGIN_CATEGORY_MODULATOR = 7
  286. # An 'utility' plugin (analyzer, converter, mixer, etc).
  287. PLUGIN_CATEGORY_UTILITY = 8
  288. # Miscellaneous plugin (used to check if the plugin has a category).
  289. PLUGIN_CATEGORY_OTHER = 9
  290. # ------------------------------------------------------------------------------------------------------------
  291. # Parameter Type
  292. # Plugin parameter type.
  293. # Null parameter type.
  294. PARAMETER_UNKNOWN = 0
  295. # Input parameter.
  296. PARAMETER_INPUT = 1
  297. # Ouput parameter.
  298. PARAMETER_OUTPUT = 2
  299. # Special (hidden) parameter.
  300. PARAMETER_SPECIAL = 3
  301. # ------------------------------------------------------------------------------------------------------------
  302. # Internal Parameter Index
  303. # Special parameters used internally in Carla.
  304. # Plugins do not know about their existence.
  305. # Null parameter.
  306. PARAMETER_NULL = -1
  307. # Active parameter, boolean type.
  308. # Default is 'false'.
  309. PARAMETER_ACTIVE = -2
  310. # Dry/Wet parameter.
  311. # Range 0.0...1.0; default is 1.0.
  312. PARAMETER_DRYWET = -3
  313. # Volume parameter.
  314. # Range 0.0...1.27; default is 1.0.
  315. PARAMETER_VOLUME = -4
  316. # Stereo Balance-Left parameter.
  317. # Range -1.0...1.0; default is -1.0.
  318. PARAMETER_BALANCE_LEFT = -5
  319. # Stereo Balance-Right parameter.
  320. # Range -1.0...1.0; default is 1.0.
  321. PARAMETER_BALANCE_RIGHT = -6
  322. # Mono Panning parameter.
  323. # Range -1.0...1.0; default is 0.0.
  324. PARAMETER_PANNING = -7
  325. # MIDI Control channel, integer type.
  326. # Range -1...15 (-1 = off).
  327. PARAMETER_CTRL_CHANNEL = -8
  328. # Max value, defined only for convenience.
  329. PARAMETER_MAX = -9
  330. # ------------------------------------------------------------------------------------------------------------
  331. # Engine Callback Opcode
  332. # Engine callback opcodes.
  333. # Front-ends must never block indefinitely during a callback.
  334. # @see EngineCallbackFunc and carla_set_engine_callback()
  335. # Debug.
  336. # This opcode is undefined and used only for testing purposes.
  337. ENGINE_CALLBACK_DEBUG = 0
  338. # A plugin has been added.
  339. # @param pluginId Plugin Id
  340. # @param valueStr Plugin name
  341. ENGINE_CALLBACK_PLUGIN_ADDED = 1
  342. # A plugin has been removed.
  343. # @param pluginId Plugin Id
  344. ENGINE_CALLBACK_PLUGIN_REMOVED = 2
  345. # A plugin has been renamed.
  346. # @param pluginId Plugin Id
  347. # @param valueStr New plugin name
  348. ENGINE_CALLBACK_PLUGIN_RENAMED = 3
  349. # A plugin has become unavailable.
  350. # @param pluginId Plugin Id
  351. # @param valueStr Related error string
  352. ENGINE_CALLBACK_PLUGIN_UNAVAILABLE = 4
  353. # A parameter value has changed.
  354. # @param pluginId Plugin Id
  355. # @param value1 Parameter index
  356. # @param value3 New parameter value
  357. ENGINE_CALLBACK_PARAMETER_VALUE_CHANGED = 5
  358. # A parameter default has changed.
  359. # @param pluginId Plugin Id
  360. # @param value1 Parameter index
  361. # @param value3 New default value
  362. ENGINE_CALLBACK_PARAMETER_DEFAULT_CHANGED = 6
  363. # A parameter's MIDI CC has changed.
  364. # @param pluginId Plugin Id
  365. # @param value1 Parameter index
  366. # @param value2 New MIDI CC
  367. ENGINE_CALLBACK_PARAMETER_MIDI_CC_CHANGED = 7
  368. # A parameter's MIDI channel has changed.
  369. # @param pluginId Plugin Id
  370. # @param value1 Parameter index
  371. # @param value2 New MIDI channel
  372. ENGINE_CALLBACK_PARAMETER_MIDI_CHANNEL_CHANGED = 8
  373. # The current program of a plugin has changed.
  374. # @param pluginId Plugin Id
  375. # @param value1 New program index
  376. ENGINE_CALLBACK_PROGRAM_CHANGED = 9
  377. # The current MIDI program of a plugin has changed.
  378. # @param pluginId Plugin Id
  379. # @param value1 New MIDI program index
  380. ENGINE_CALLBACK_MIDI_PROGRAM_CHANGED = 10
  381. # A plugin's custom UI state has changed.
  382. # @param pluginId Plugin Id
  383. # @param value1 New state, as follows:
  384. # 0: UI is now hidden
  385. # 1: UI is now visible
  386. # -1: UI has crashed and should not be shown again
  387. ENGINE_CALLBACK_UI_STATE_CHANGED = 11
  388. # A note has been pressed.
  389. # @param pluginId Plugin Id
  390. # @param value1 Channel
  391. # @param value2 Note
  392. # @param value3 Velocity
  393. ENGINE_CALLBACK_NOTE_ON = 12
  394. # A note has been released.
  395. # @param pluginId Plugin Id
  396. # @param value1 Channel
  397. # @param value2 Note
  398. ENGINE_CALLBACK_NOTE_OFF = 13
  399. # A plugin needs update.
  400. # @param pluginId Plugin Id
  401. ENGINE_CALLBACK_UPDATE = 14
  402. # A plugin's data/information has changed.
  403. # @param pluginId Plugin Id
  404. ENGINE_CALLBACK_RELOAD_INFO = 15
  405. # A plugin's parameters have changed.
  406. # @param pluginId Plugin Id
  407. ENGINE_CALLBACK_RELOAD_PARAMETERS = 16
  408. # A plugin's programs have changed.
  409. # @param pluginId Plugin Id
  410. ENGINE_CALLBACK_RELOAD_PROGRAMS = 17
  411. # A plugin state has changed.
  412. # @param pluginId Plugin Id
  413. ENGINE_CALLBACK_RELOAD_ALL = 18
  414. # A patchbay client has been added.
  415. # @param pluginId Client Id
  416. # @param valueStr Client name and icon, as "name:icon"
  417. ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED = 19
  418. # A patchbay client has been removed.
  419. # @param pluginId Client Id
  420. ENGINE_CALLBACK_PATCHBAY_CLIENT_REMOVED = 20
  421. # A patchbay client has been renamed.
  422. # @param pluginId Client Id
  423. # @param valueStr New client name
  424. ENGINE_CALLBACK_PATCHBAY_CLIENT_RENAMED = 21
  425. # A patchbay client icon has changed.
  426. # @param pluginId Client Id
  427. # @param valueStr New icon name
  428. ENGINE_CALLBACK_PATCHBAY_CLIENT_ICON_CHANGED = 22
  429. # A patchbay port has been added.
  430. # @param pluginId Client Id
  431. # @param value1 Port Id
  432. # @param value2 Port hints
  433. # @param valueStr Port name
  434. # @see PatchbayPortHints
  435. ENGINE_CALLBACK_PATCHBAY_PORT_ADDED = 23
  436. # A patchbay port has been removed.
  437. # @param pluginId Client Id
  438. # @param value1 Port Id
  439. ENGINE_CALLBACK_PATCHBAY_PORT_REMOVED = 24
  440. # A patchbay port has been renamed.
  441. # @param pluginId Client Id
  442. # @param value1 Port Id
  443. # @param valueStr New port name
  444. ENGINE_CALLBACK_PATCHBAY_PORT_RENAMED = 25
  445. # A patchbay connection has been added.
  446. # @param pluginId Connection Id
  447. # @param value1 Output port Id
  448. # @param value2 Input port Id
  449. ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED = 26
  450. # A patchbay connection has been removed.
  451. # @param pluginId Connection Id
  452. # @param value1 Output port Id
  453. # @param value2 Input port Id
  454. ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED = 27
  455. # Engine started.
  456. # @param value1 Process mode
  457. # @param value2 Transport mode
  458. # @param valuestr Engine driver
  459. # @see EngineProcessMode
  460. # @see EngineTransportMode
  461. ENGINE_CALLBACK_ENGINE_STARTED = 28
  462. # Engine stopped.
  463. ENGINE_CALLBACK_ENGINE_STOPPED = 29
  464. # Engine process mode has changed.
  465. # @param value1 New process mode
  466. # @see EngineProcessMode
  467. ENGINE_CALLBACK_PROCESS_MODE_CHANGED = 30
  468. # Engine transport mode has changed.
  469. # @param value1 New transport mode
  470. # @see EngineTransportMode
  471. ENGINE_CALLBACK_TRANSPORT_MODE_CHANGED = 31
  472. # Engine buffer-size changed.
  473. # @param value1 New buffer size
  474. ENGINE_CALLBACK_BUFFER_SIZE_CHANGED = 32
  475. # Engine sample-rate changed.
  476. # @param value3 New sample rate
  477. ENGINE_CALLBACK_SAMPLE_RATE_CHANGED = 33
  478. # Show a message as information.
  479. # @param valueStr The message
  480. ENGINE_CALLBACK_INFO = 34
  481. # Show a message as an error.
  482. # @param valueStr The message
  483. ENGINE_CALLBACK_ERROR = 35
  484. # The engine has crashed or malfunctioned and will no longer work.
  485. ENGINE_CALLBACK_QUIT = 36
  486. # ------------------------------------------------------------------------------------------------------------
  487. # Engine Option
  488. # Engine options.
  489. # @see carla_set_engine_option()
  490. # Debug.
  491. # This option is undefined and used only for testing purposes.
  492. ENGINE_OPTION_DEBUG = 0
  493. # Set the engine processing mode.
  494. # Default is ENGINE_PROCESS_MODE_MULTIPLE_CLIENTS on Linux and ENGINE_PROCESS_MODE_CONTINUOUS_RACK for all other OSes.
  495. # @see EngineProcessMode
  496. ENGINE_OPTION_PROCESS_MODE = 1
  497. # Set the engine transport mode.
  498. # Default is ENGINE_TRANSPORT_MODE_JACK on Linux and ENGINE_TRANSPORT_MODE_INTERNAL for all other OSes.
  499. # @see EngineTransportMode
  500. ENGINE_OPTION_TRANSPORT_MODE = 2
  501. # Force mono plugins as stereo, by running 2 instances at the same time.
  502. # Default is false, but always true when process mode is ENGINE_PROCESS_MODE_CONTINUOUS_RACK.
  503. # @note Not supported by all plugins
  504. # @see PLUGIN_OPTION_FORCE_STEREO
  505. ENGINE_OPTION_FORCE_STEREO = 3
  506. # Use plugin bridges whenever possible.
  507. # Default is no, EXPERIMENTAL.
  508. ENGINE_OPTION_PREFER_PLUGIN_BRIDGES = 4
  509. # Use UI bridges whenever possible, otherwise UIs will be directly handled in the main backend thread.
  510. # Default is yes.
  511. ENGINE_OPTION_PREFER_UI_BRIDGES = 5
  512. # Make custom plugin UIs always-on-top.
  513. # Default is yes.
  514. ENGINE_OPTION_UIS_ALWAYS_ON_TOP = 6
  515. # Maximum number of parameters allowed.
  516. # Default is MAX_DEFAULT_PARAMETERS.
  517. ENGINE_OPTION_MAX_PARAMETERS = 7
  518. # Timeout value for how much to wait for UI bridges to respond, in milliseconds.
  519. # Default is 4000 (4 seconds).
  520. ENGINE_OPTION_UI_BRIDGES_TIMEOUT = 8
  521. # Audio number of periods.
  522. # Default is 2.
  523. ENGINE_OPTION_AUDIO_NUM_PERIODS = 9
  524. # Audio buffer size.
  525. # Default is 512.
  526. ENGINE_OPTION_AUDIO_BUFFER_SIZE = 10
  527. # Audio sample rate.
  528. # Default is 44100.
  529. ENGINE_OPTION_AUDIO_SAMPLE_RATE = 11
  530. # Audio device (within a driver).
  531. # Default unset.
  532. ENGINE_OPTION_AUDIO_DEVICE = 12
  533. # Set path to the binary files.
  534. # Default unset.
  535. # @note Must be set for plugin and UI bridges to work
  536. ENGINE_OPTION_PATH_BINARIES = 13
  537. # Set path to the resource files.
  538. # Default unset.
  539. # @note Must be set for some internal plugins to work
  540. ENGINE_OPTION_PATH_RESOURCES = 14
  541. # ------------------------------------------------------------------------------------------------------------
  542. # Engine Process Mode
  543. # Engine process mode.
  544. # @see ENGINE_OPTION_PROCESS_MODE
  545. # Single client mode.
  546. # Inputs and outputs are added dynamically as needed by plugins.
  547. ENGINE_PROCESS_MODE_SINGLE_CLIENT = 0
  548. # Multiple client mode.
  549. # It has 1 master client + 1 client per plugin.
  550. ENGINE_PROCESS_MODE_MULTIPLE_CLIENTS = 1
  551. # Single client, 'rack' mode.
  552. # Processes plugins in order of Id, with forced stereo always on.
  553. ENGINE_PROCESS_MODE_CONTINUOUS_RACK = 2
  554. # Single client, 'patchbay' mode.
  555. ENGINE_PROCESS_MODE_PATCHBAY = 3
  556. # Special mode, used in plugin-bridges only.
  557. ENGINE_PROCESS_MODE_BRIDGE = 4
  558. # ------------------------------------------------------------------------------------------------------------
  559. # Engine Transport Mode
  560. # Engine transport mode.
  561. # @see ENGINE_OPTION_TRANSPORT_MODE
  562. # Internal transport mode.
  563. ENGINE_TRANSPORT_MODE_INTERNAL = 0
  564. # Transport from JACK.
  565. # Only available if driver name is "JACK".
  566. ENGINE_TRANSPORT_MODE_JACK = 1
  567. # Transport from host, used when Carla is a plugin.
  568. ENGINE_TRANSPORT_MODE_PLUGIN = 2
  569. # Special mode, used in plugin-bridges only.
  570. ENGINE_TRANSPORT_MODE_BRIDGE = 3
  571. # ------------------------------------------------------------------------------------------------------------
  572. # Carla Backend API (C stuff)
  573. # Engine callback function.
  574. # Front-ends must never block indefinitely during a callback.
  575. # @see EngineCallbackOpcode and carla_set_engine_callback()
  576. EngineCallbackFunc = CFUNCTYPE(None, c_void_p, c_enum, c_uint, c_int, c_int, c_float, c_char_p)
  577. # Parameter data.
  578. class ParameterData(Structure):
  579. _fields_ = [
  580. # This parameter type.
  581. ("type", c_enum),
  582. # This parameter hints.
  583. # @see ParameterHints
  584. ("hints", c_uint),
  585. # Index as seen by Carla.
  586. ("index", c_int32),
  587. # Real index as seen by plugins.
  588. ("rindex", c_int32),
  589. # Currently mapped MIDI CC.
  590. # A value lower than 0 means invalid or unused.
  591. # Maximum allowed value is 95 (0x5F).
  592. ("midiCC", c_int16),
  593. # Currently mapped MIDI channel.
  594. # Counts from 0 to 15.
  595. ("midiChannel", c_uint8)
  596. ]
  597. # Parameter ranges.
  598. class ParameterRanges(Structure):
  599. _fields_ = [
  600. # Default value.
  601. ("def", c_float),
  602. # Minimum value.
  603. ("min", c_float),
  604. # Maximum value.
  605. ("max", c_float),
  606. # Regular, single step value.
  607. ("step", c_float),
  608. # Small step value.
  609. ("stepSmall", c_float),
  610. # Large step value.
  611. ("stepLarge", c_float)
  612. ]
  613. # MIDI Program data.
  614. class MidiProgramData(Structure):
  615. _fields_ = [
  616. # MIDI bank.
  617. ("bank", c_uint32),
  618. # MIDI program.
  619. ("program", c_uint32),
  620. # MIDI program name.
  621. ("name", c_char_p)
  622. ]
  623. # Custom data, used for saving key:value 'dictionaries'.
  624. class CustomData(Structure):
  625. _fields_ = [
  626. # Value type, in URI form.
  627. # @see CustomDataTypes
  628. ("type", c_char_p),
  629. # Key.
  630. # @see CustomDataKeys
  631. ("key", c_char_p),
  632. # Value.
  633. ("value", c_char_p)
  634. ]
  635. # Engine driver device information.
  636. class EngineDriverDeviceInfo(Structure):
  637. _fields_ = [
  638. # This driver device hints.
  639. # @see EngineDriverHints
  640. ("hints", c_uint),
  641. # Available buffer sizes.
  642. # Terminated with 0.
  643. ("bufferSizes", POINTER(c_uint32)),
  644. # Available sample rates.
  645. # Terminated with 0.0.
  646. ("sampleRates", POINTER(c_double))
  647. ]
  648. # ------------------------------------------------------------------------------------------------------------
  649. # Carla Backend API (Python compatible stuff)
  650. # @see ParameterData
  651. PyParameterData = {
  652. 'type': PARAMETER_UNKNOWN,
  653. 'hints': 0x0,
  654. 'index': PARAMETER_NULL,
  655. 'rindex': -1,
  656. 'midiCC': -1,
  657. 'midiChannel': 0
  658. }
  659. # @see ParameterRanges
  660. PyParameterRanges = {
  661. 'def': 0.0,
  662. 'min': 0.0,
  663. 'max': 1.0,
  664. 'step': 0.01,
  665. 'stepSmall': 0.0001,
  666. 'stepLarge': 0.1
  667. }
  668. # @see MidiProgramData
  669. PyMidiProgramData = {
  670. 'bank': 0,
  671. 'program': 0,
  672. 'name': None
  673. }
  674. # @see CustomData
  675. PyCustomData = {
  676. 'type': None,
  677. 'key': None,
  678. 'value': None
  679. }
  680. # @see EngineDriverDeviceInfo
  681. PyEngineDriverDeviceInfo = {
  682. 'hints': 0x0,
  683. 'bufferSizes': [],
  684. 'sampleRates': []
  685. }
  686. # ------------------------------------------------------------------------------------------------------------
  687. # File Callback Opcode
  688. # File callback opcodes.
  689. # Front-ends must always block-wait for user input.
  690. # @see FileCallbackFunc and carla_set_file_callback()
  691. # Debug.
  692. # This opcode is undefined and used only for testing purposes.
  693. FILE_CALLBACK_DEBUG = 0
  694. # Open file or folder.
  695. FILE_CALLBACK_OPEN = 1
  696. # Save file or folder.
  697. FILE_CALLBACK_SAVE = 2
  698. # ------------------------------------------------------------------------------------------------------------
  699. # Carla Host API (C stuff)
  700. # File callback function.
  701. # @see FileCallbackOpcode
  702. FileCallbackFunc = CFUNCTYPE(c_char_p, c_void_p, c_enum, c_bool, c_char_p, c_char_p)
  703. # Information about a loaded plugin.
  704. # @see carla_get_plugin_info()
  705. class CarlaPluginInfo(Structure):
  706. _fields_ = [
  707. # Plugin type.
  708. ("type", c_enum),
  709. # Plugin category.
  710. ("category", c_enum),
  711. # Plugin hints.
  712. # @see PluginHints
  713. ("hints", c_uint),
  714. # Plugin options available for the user to change.
  715. # @see PluginOptions
  716. ("optionsAvailable", c_uint),
  717. # Plugin options currently enabled.
  718. # Some options are enabled but not available, which means they will always be on.
  719. # @see PluginOptions
  720. ("optionsEnabled", c_uint),
  721. # Plugin filename.
  722. # This can be the plugin binary or resource file.
  723. ("filename", c_char_p),
  724. # Plugin name.
  725. # This name is unique within a Carla instance.
  726. # @see carla_get_real_plugin_name()
  727. ("name", c_char_p),
  728. # Plugin label or URI.
  729. ("label", c_char_p),
  730. # Plugin author/maker.
  731. ("maker", c_char_p),
  732. # Plugin copyright/license.
  733. ("copyright", c_char_p),
  734. # Icon name for this plugin, in lowercase.
  735. # Default is "plugin".
  736. ("iconName", c_char_p),
  737. # Patchbay client Id for this plugin.
  738. # When 0, Id is considered invalid or unused.
  739. ("patchbayClientId", c_int),
  740. # Plugin unique Id.
  741. # This Id is dependant on the plugin type and may sometimes be 0.
  742. ("uniqueId", c_long)
  743. ]
  744. # Information about an internal Carla plugin.
  745. # @see carla_get_internal_plugin_info()
  746. class CarlaNativePluginInfo(Structure):
  747. _fields_ = [
  748. # Plugin category.
  749. ("category", c_enum),
  750. # Plugin hints.
  751. # @see PluginHints
  752. ("hints", c_uint),
  753. # Number of audio inputs.
  754. ("audioIns", c_uint32),
  755. # Number of audio outputs.
  756. ("audioOuts", c_uint32),
  757. # Number of MIDI inputs.
  758. ("midiIns", c_uint32),
  759. # Number of MIDI outputs.
  760. ("midiOuts", c_uint32),
  761. # Number of input parameters.
  762. ("parameterIns", c_uint32),
  763. # Number of output parameters.
  764. ("parameterOuts", c_uint32),
  765. # Plugin name.
  766. ("name", c_char_p),
  767. # Plugin label.
  768. ("label", c_char_p),
  769. # Plugin author/maker.
  770. ("maker", c_char_p),
  771. # Plugin copyright/license.
  772. ("copyright", c_char_p)
  773. ]
  774. # Port count information, used for Audio and MIDI ports and parameters.
  775. # @see carla_get_audio_port_count_info()
  776. # @see carla_get_midi_port_count_info()
  777. # @see carla_get_parameter_count_info()
  778. class CarlaPortCountInfo(Structure):
  779. _fields_ = [
  780. # Number of inputs.
  781. ("ins", c_uint32),
  782. # Number of outputs.
  783. ("outs", c_uint32)
  784. ]
  785. # Parameter information.
  786. # @see carla_get_parameter_info()
  787. class CarlaParameterInfo(Structure):
  788. _fields_ = [
  789. # Parameter name.
  790. ("name", c_char_p),
  791. # Parameter symbol.
  792. ("symbol", c_char_p),
  793. # Parameter unit.
  794. ("unit", c_char_p),
  795. # Number of scale points.
  796. # @see CarlaScalePointInfo
  797. ("scalePointCount", c_uint32)
  798. ]
  799. # Parameter scale point information.
  800. # @see carla_get_parameter_scalepoint_info()
  801. class CarlaScalePointInfo(Structure):
  802. _fields_ = [
  803. # Scale point value.
  804. ("value", c_float),
  805. # Scale point label.
  806. ("label", c_char_p)
  807. ]
  808. # Transport information.
  809. # @see carla_get_transport_info()
  810. class CarlaTransportInfo(Structure):
  811. _fields_ = [
  812. # Wherever transport is playing.
  813. ("playing", c_bool),
  814. # Current transport frame.
  815. ("frame", c_uint64),
  816. # Bar
  817. ("bar", c_int32),
  818. # Beat
  819. ("beat", c_int32),
  820. # Tick
  821. ("tick", c_int32),
  822. # Beats per minute.
  823. ("bpm", c_double)
  824. ]
  825. # ------------------------------------------------------------------------------------------------------------
  826. # Carla Host API (Python compatible stuff)
  827. # @see CarlaPluginInfo
  828. PyCarlaPluginInfo = {
  829. 'type': PLUGIN_NONE,
  830. 'category': PLUGIN_CATEGORY_NONE,
  831. 'hints': 0x0,
  832. 'optionsAvailable': 0x0,
  833. 'optionsEnabled': 0x0,
  834. 'filename': None,
  835. 'name': None,
  836. 'label': None,
  837. 'maker': None,
  838. 'copyright': None,
  839. 'iconName': None,
  840. 'patchbayClientId': 0,
  841. 'uniqueId': 0
  842. }
  843. # @see CarlaPortCountInfo
  844. PyCarlaPortCountInfo = {
  845. 'ins': 0,
  846. 'outs': 0
  847. }
  848. # @see CarlaParameterInfo
  849. PyCarlaParameterInfo = {
  850. 'name': None,
  851. 'symbol': None,
  852. 'unit': None,
  853. 'scalePointCount': 0,
  854. }
  855. # @see CarlaScalePointInfo
  856. PyCarlaScalePointInfo = {
  857. 'value': 0.0,
  858. 'label': None
  859. }
  860. # @see CarlaTransportInfo
  861. PyCarlaTransportInfo = {
  862. "playing": False,
  863. "frame": 0,
  864. "bar": 0,
  865. "beat": 0,
  866. "tick": 0,
  867. "bpm": 0.0
  868. }
  869. # ------------------------------------------------------------------------------------------------------------
  870. # Set BINARY_NATIVE
  871. if HAIKU or LINUX or MACOS:
  872. BINARY_NATIVE = BINARY_POSIX64 if kIs64bit else BINARY_POSIX32
  873. elif WINDOWS:
  874. BINARY_NATIVE = BINARY_WIN64 if kIs64bit else BINARY_WIN32
  875. else:
  876. BINARY_NATIVE = BINARY_OTHER
  877. # ------------------------------------------------------------------------------------------------------------
  878. # Python Host object (Control/Standalone)
  879. class Host(object):
  880. def __init__(self, libName):
  881. object.__init__(self)
  882. self._init(libName)
  883. # Get the complete license text of used third-party code and features.
  884. # Returned string is in basic html format.
  885. def get_complete_license_text(self):
  886. return charPtrToString(self.lib.carla_get_complete_license_text())
  887. # Get all the supported file extensions in carla_load_file().
  888. # Returned string uses this syntax:
  889. # @code
  890. # "*.ext1;*.ext2;*.ext3"
  891. # @endcode
  892. def get_supported_file_extensions(self):
  893. return charPtrToString(self.lib.carla_get_supported_file_extensions())
  894. # Get how many engine drivers are available.
  895. def get_engine_driver_count(self):
  896. return int(self.lib.carla_get_engine_driver_count())
  897. # Get an engine driver name.
  898. # @param index Driver index
  899. def get_engine_driver_name(self, index):
  900. return charPtrToString(self.lib.carla_get_engine_driver_name(index))
  901. # Get the device names of an engine driver.
  902. # @param index Driver index
  903. def get_engine_driver_device_names(self, index):
  904. return charPtrPtrToStringList(self.lib.carla_get_engine_driver_device_names(index))
  905. # Get information about a device driver.
  906. # @param index Driver index
  907. # @param name Device name
  908. def get_engine_driver_device_info(self, index, name):
  909. return structToDict(self.lib.carla_get_engine_driver_device_info(index, name).contents)
  910. # Get how many internal plugins are available.
  911. def get_internal_plugin_count(self):
  912. return int(self.lib.carla_get_internal_plugin_count())
  913. # Get information about an internal plugin.
  914. # @param index Internal plugin Id
  915. def get_internal_plugin_info(self, index):
  916. return structToDict(self.lib.carla_get_internal_plugin_info(index).contents)
  917. # Initialize the engine.
  918. # Make sure to call carla_engine_idle() at regular intervals afterwards.
  919. # @param driverName Driver to use
  920. # @param clientName Engine master client name
  921. def engine_init(self, driverName, clientName):
  922. return bool(self.lib.carla_engine_init(driverName.encode("utf-8"), clientName.encode("utf-8")))
  923. # Close the engine.
  924. # This function always closes the engine even if it returns false.
  925. # In other words, even when something goes wrong when closing the engine it still be closed nonetheless.
  926. def engine_close(self):
  927. return bool(self.lib.carla_engine_close())
  928. # Idle the engine.
  929. # Do not call this if the engine is not running.
  930. def engine_idle(self):
  931. self.lib.carla_engine_idle()
  932. # Check if the engine is running.
  933. def is_engine_running(self):
  934. return bool(self.lib.carla_is_engine_running())
  935. # Tell the engine it's about to close.
  936. # This is used to prevent the engine thread(s) from reactivating.
  937. def set_engine_about_to_close(self):
  938. self.lib.carla_set_engine_about_to_close()
  939. # Set the engine callback function.
  940. # @param func Callback function
  941. def set_engine_callback(self, func):
  942. self._engineCallback = EngineCallbackFunc(func)
  943. self.lib.carla_set_engine_callback(self._engineCallback, None)
  944. # Set an engine option.
  945. # @param option Option
  946. # @param value Value as number
  947. # @param valueStr Value as string
  948. def set_engine_option(self, option, value, valueStr):
  949. self.lib.carla_set_engine_option(option, value, valueStr.encode("utf-8"))
  950. # Set the file callback function.
  951. # @param func Callback function
  952. # @param ptr Callback pointer
  953. def set_file_callback(self, func):
  954. self._fileCallback = FileCallbackFunc(func)
  955. self.lib.carla_set_file_callback(self._fileCallback, None)
  956. # Load a file of any type.\n
  957. # This will try to load a generic file as a plugin,
  958. # either by direct handling (Csound, GIG, SF2 and SFZ) or by using an internal plugin (like Audio and MIDI).
  959. # @param Filename Filename
  960. # @see carla_get_supported_file_extensions()
  961. def load_file(self, filename):
  962. return bool(self.lib.carla_load_file(filename.encode("utf-8")))
  963. # Load a Carla project file.
  964. # @param Filename Filename
  965. # @note Currently loaded plugins are not removed; call carla_remove_all_plugins() first if needed.
  966. def load_project(self, filename):
  967. return bool(self.lib.carla_load_project(filename.encode("utf-8")))
  968. # Save current project to a file.
  969. # @param Filename Filename
  970. def save_project(self, filename):
  971. return bool(self.lib.carla_save_project(filename.encode("utf-8")))
  972. # Connect two patchbay ports.
  973. # @param portIdA Output port
  974. # @param portIdB Input port
  975. # @see ENGINE_CALLBACK_PATCHBAY_CONNECTION_ADDED
  976. def patchbay_connect(self, portIdA, portIdB):
  977. return bool(self.lib.carla_patchbay_connect(portIdA, portIdB))
  978. # Disconnect two patchbay ports.
  979. # @param connectionId Connection Id
  980. # @see ENGINE_CALLBACK_PATCHBAY_CONNECTION_REMOVED
  981. def patchbay_disconnect(self, connectionId):
  982. return bool(self.lib.carla_patchbay_disconnect(connectionId))
  983. # Force the engine to resend all patchbay clients, ports and connections again.
  984. def patchbay_refresh(self):
  985. return bool(self.lib.carla_patchbay_refresh())
  986. # Start playback of the engine transport.
  987. def transport_play(self):
  988. self.lib.carla_transport_play()
  989. # Pause the engine transport.
  990. def transport_pause(self):
  991. self.lib.carla_transport_pause()
  992. # Relocate the engine transport to a specific frame.
  993. # @param frames Frame to relocate to.
  994. def transport_relocate(self, frame):
  995. self.lib.carla_transport_relocate(frame)
  996. # Get the current transport frame.
  997. def get_current_transport_frame(self):
  998. return bool(self.lib.carla_get_current_transport_frame())
  999. # Get the engine transport information.
  1000. def get_transport_info(self):
  1001. return structToDict(self.lib.carla_get_transport_info().contents)
  1002. # Add a new plugin.
  1003. # If you don't know the binary type use the BINARY_NATIVE macro.
  1004. # @param btype Binary type
  1005. # @param ptype Plugin type
  1006. # @param filename Filename, if applicable
  1007. # @param name Name of the plugin, can be NULL
  1008. # @param label Plugin label, if applicable
  1009. # @param extraPtr Extra pointer, defined per plugin type
  1010. def add_plugin(self, btype, ptype, filename, name, label, extraPtr):
  1011. cfilename = filename.encode("utf-8") if filename else None
  1012. cname = name.encode("utf-8") if name else None
  1013. clabel = label.encode("utf-8") if label else None
  1014. return bool(self.lib.carla_add_plugin(btype, ptype, cfilename, cname, clabel, cast(extraPtr, c_void_p)))
  1015. # Remove a plugin.
  1016. # @param pluginId Plugin to remove.
  1017. def remove_plugin(self, pluginId):
  1018. return bool(self.lib.carla_remove_plugin(pluginId))
  1019. # Remove all plugins.
  1020. def remove_all_plugins(self):
  1021. return bool(self.lib.carla_remove_all_plugins())
  1022. # Rename a plugin.\n
  1023. # Returns the new name, or NULL if the operation failed.
  1024. # @param pluginId Plugin to rename
  1025. # @param newName New plugin name
  1026. def rename_plugin(self, pluginId, newName):
  1027. return charPtrToString(self.lib.carla_rename_plugin(pluginId, newName.encode("utf-8")))
  1028. # Clone a plugin.
  1029. # @param pluginId Plugin to clone
  1030. def clone_plugin(self, pluginId):
  1031. return bool(self.lib.carla_clone_plugin(pluginId))
  1032. # Prepare replace of a plugin.\n
  1033. # The next call to carla_add_plugin() will use this id, replacing the current plugin.
  1034. # @param pluginId Plugin to replace
  1035. # @note This function requires carla_add_plugin() to be called afterwards *as soon as possible*.
  1036. def replace_plugin(self, pluginId):
  1037. return bool(self.lib.carla_replace_plugin(pluginId))
  1038. # Switch two plugins positions.
  1039. # @param pluginIdA Plugin A
  1040. # @param pluginIdB Plugin B
  1041. def switch_plugins(self, pluginIdA, pluginIdB):
  1042. return bool(self.lib.carla_switch_plugins(pluginIdA, pluginIdB))
  1043. # Load a plugin state.
  1044. # @param pluginId Plugin
  1045. # @param filename Path to plugin state
  1046. # @see carla_save_plugin_state()
  1047. def load_plugin_state(self, pluginId, filename):
  1048. return bool(self.lib.carla_load_plugin_state(pluginId, filename.encode("utf-8")))
  1049. # Save a plugin state.
  1050. # @param pluginId Plugin
  1051. # @param filename Path to plugin state
  1052. # @see carla_load_plugin_state()
  1053. def save_plugin_state(self, pluginId, filename):
  1054. return bool(self.lib.carla_save_plugin_state(pluginId, filename.encode("utf-8")))
  1055. # Get information from a plugin.
  1056. # @param pluginId Plugin
  1057. def get_plugin_info(self, pluginId):
  1058. return structToDict(self.lib.carla_get_plugin_info(pluginId).contents)
  1059. # Get audio port count information from a plugin.
  1060. # @param pluginId Plugin
  1061. def get_audio_port_count_info(self, pluginId):
  1062. return structToDict(self.lib.carla_get_audio_port_count_info(pluginId).contents)
  1063. # Get MIDI port count information from a plugin.
  1064. # @param pluginId Plugin
  1065. def get_midi_port_count_info(self, pluginId):
  1066. return structToDict(self.lib.carla_get_midi_port_count_info(pluginId).contents)
  1067. # Get parameter count information from a plugin.
  1068. # @param pluginId Plugin
  1069. def get_parameter_count_info(self, pluginId):
  1070. return structToDict(self.lib.carla_get_parameter_count_info(pluginId).contents)
  1071. # Get parameter information from a plugin.
  1072. # @param pluginId Plugin
  1073. # @param parameterId Parameter index
  1074. # @see carla_get_parameter_count()
  1075. def get_parameter_info(self, pluginId, parameterId):
  1076. return structToDict(self.lib.carla_get_parameter_info(pluginId, parameterId).contents)
  1077. # Get parameter scale point information from a plugin.
  1078. # @param pluginId Plugin
  1079. # @param parameterId Parameter index
  1080. # @param scalePointId Parameter scale-point index
  1081. # @see CarlaParameterInfo::scalePointCount
  1082. def get_parameter_scalepoint_info(self, pluginId, parameterId, scalePointId):
  1083. return structToDict(self.lib.carla_get_parameter_scalepoint_info(pluginId, parameterId, scalePointId).contents)
  1084. # Get a plugin's parameter data.
  1085. # @param pluginId Plugin
  1086. # @param parameterId Parameter index
  1087. # @see carla_get_parameter_count()
  1088. def get_parameter_data(self, pluginId, parameterId):
  1089. return structToDict(self.lib.carla_get_parameter_data(pluginId, parameterId).contents)
  1090. # Get a plugin's parameter ranges.
  1091. # @param pluginId Plugin
  1092. # @param parameterId Parameter index
  1093. # @see carla_get_parameter_count()
  1094. def get_parameter_ranges(self, pluginId, parameterId):
  1095. return structToDict(self.lib.carla_get_parameter_ranges(pluginId, parameterId).contents)
  1096. # Get a plugin's MIDI program data.
  1097. # @param pluginId Plugin
  1098. # @param midiProgramId MIDI Program index
  1099. # @see carla_get_midi_program_count()
  1100. def get_midi_program_data(self, pluginId, midiProgramId):
  1101. return structToDict(self.lib.carla_get_midi_program_data(pluginId, midiProgramId).contents)
  1102. # Get a plugin's custom data.
  1103. # @param pluginId Plugin
  1104. # @param customDataId Custom data index
  1105. # @see carla_get_custom_data_count()
  1106. def get_custom_data(self, pluginId, customDataId):
  1107. return structToDict(self.lib.carla_get_custom_data(pluginId, customDataId).contents)
  1108. # Get a plugin's chunk data.
  1109. # @param pluginId Plugin
  1110. # @see PLUGIN_OPTION_USE_CHUNKS
  1111. def get_chunk_data(self, pluginId):
  1112. return charPtrToString(self.lib.carla_get_chunk_data(pluginId))
  1113. # Get how many parameters a plugin has.
  1114. # @param pluginId Plugin
  1115. def get_parameter_count(self, pluginId):
  1116. return int(self.lib.carla_get_parameter_count(pluginId))
  1117. # Get how many programs a plugin has.
  1118. # @param pluginId Plugin
  1119. # @see carla_get_program_name()
  1120. def get_program_count(self, pluginId):
  1121. return int(self.lib.carla_get_program_count(pluginId))
  1122. # Get how many MIDI programs a plugin has.
  1123. # @param pluginId Plugin
  1124. # @see carla_get_midi_program_name() and carla_get_midi_program_data()
  1125. def get_midi_program_count(self, pluginId):
  1126. return int(self.lib.carla_get_midi_program_count(pluginId))
  1127. # Get how many custom data sets a plugin has.
  1128. # @param pluginId Plugin
  1129. # @see carla_get_custom_data()
  1130. def get_custom_data_count(self, pluginId):
  1131. return int(self.lib.carla_get_custom_data_count(pluginId))
  1132. # Get a plugin's parameter text (custom display of internal values).
  1133. # @param pluginId Plugin
  1134. # @param parameterId Parameter index
  1135. # @see PARAMETER_USES_CUSTOM_TEXT
  1136. def get_parameter_text(self, pluginId, parameterId):
  1137. return charPtrToString(self.lib.carla_get_parameter_text(pluginId, parameterId))
  1138. # Get a plugin's program name.
  1139. # @param pluginId Plugin
  1140. # @param programId Program index
  1141. # @see carla_get_program_count()
  1142. def get_program_name(self, pluginId, programId):
  1143. return charPtrToString(self.lib.carla_get_program_name(pluginId, programId))
  1144. # Get a plugin's MIDI program name.
  1145. # @param pluginId Plugin
  1146. # @param midiProgramId MIDI Program index
  1147. # @see carla_get_midi_program_count()
  1148. def get_midi_program_name(self, pluginId, midiProgramId):
  1149. return charPtrToString(self.lib.carla_get_midi_program_name(pluginId, midiProgramId))
  1150. # Get a plugin's real name.\n
  1151. # This is the name the plugin uses to identify itself; may not be unique.
  1152. # @param pluginId Plugin
  1153. def get_real_plugin_name(self, pluginId):
  1154. return charPtrToString(self.lib.carla_get_real_plugin_name(pluginId))
  1155. # Get a plugin's program index.
  1156. # @param pluginId Plugin
  1157. def get_current_program_index(self, pluginId):
  1158. return int(self.lib.carla_get_current_program_index(pluginId))
  1159. # Get a plugin's midi program index.
  1160. # @param pluginId Plugin
  1161. def get_current_midi_program_index(self, pluginId):
  1162. return int(self.lib.carla_get_current_midi_program_index(pluginId))
  1163. # Get a plugin's default parameter value.
  1164. # @param pluginId Plugin
  1165. # @param parameterId Parameter index
  1166. def get_default_parameter_value(self, pluginId, parameterId):
  1167. return float(self.lib.carla_get_default_parameter_value(pluginId, parameterId))
  1168. # Get a plugin's current parameter value.
  1169. # @param pluginId Plugin
  1170. # @param parameterId Parameter index
  1171. def get_current_parameter_value(self, pluginId, parameterId):
  1172. return float(self.lib.carla_get_current_parameter_value(pluginId, parameterId))
  1173. # Get a plugin's input peak value.
  1174. # @param pluginId Plugin
  1175. # @param isLeft Wherever to get the left/mono value, otherwise right.
  1176. def get_input_peak_value(self, pluginId, isLeft):
  1177. return float(self.lib.carla_get_input_peak_value(pluginId, isLeft))
  1178. # Get a plugin's output peak value.
  1179. # @param pluginId Plugin
  1180. # @param isLeft Wherever to get the left/mono value, otherwise right.
  1181. def get_output_peak_value(self, pluginId, isLeft):
  1182. return float(self.lib.carla_get_output_peak_value(pluginId, isLeft))
  1183. # Enable a plugin's option.
  1184. # @param pluginId Plugin
  1185. # @param option An option from PluginOptions
  1186. # @param yesNo New enabled state
  1187. def set_option(self, pluginId, option, yesNo):
  1188. self.lib.carla_set_option(pluginId, option, yesNo)
  1189. # Enable or disable a plugin.
  1190. # @param pluginId Plugin
  1191. # @param onOff New active state
  1192. def set_active(self, pluginId, onOff):
  1193. self.lib.carla_set_active(pluginId, onOff)
  1194. # Change a plugin's internal dry/wet.
  1195. # @param pluginId Plugin
  1196. # @param value New dry/wet value
  1197. def set_drywet(self, pluginId, value):
  1198. self.lib.carla_set_drywet(pluginId, value)
  1199. # Change a plugin's internal volume.
  1200. # @param pluginId Plugin
  1201. # @param value New volume
  1202. def set_volume(self, pluginId, value):
  1203. self.lib.carla_set_volume(pluginId, value)
  1204. # Change a plugin's internal stereo balance, left channel.
  1205. # @param pluginId Plugin
  1206. # @param value New value
  1207. def set_balance_left(self, pluginId, value):
  1208. self.lib.carla_set_balance_left(pluginId, value)
  1209. # Change a plugin's internal stereo balance, right channel.
  1210. # @param pluginId Plugin
  1211. # @param value New value
  1212. def set_balance_right(self, pluginId, value):
  1213. self.lib.carla_set_balance_right(pluginId, value)
  1214. # Change a plugin's internal mono panning value.
  1215. # @param pluginId Plugin
  1216. # @param value New value
  1217. def set_panning(self, pluginId, value):
  1218. self.lib.carla_set_panning(pluginId, value)
  1219. # Change a plugin's internal control channel.
  1220. # @param pluginId Plugin
  1221. # @param channel New channel
  1222. def set_ctrl_channel(self, pluginId, channel):
  1223. self.lib.carla_set_ctrl_channel(pluginId, channel)
  1224. # Change a plugin's parameter value.
  1225. # @param pluginId Plugin
  1226. # @param parameterId Parameter index
  1227. # @param value New value
  1228. def set_parameter_value(self, pluginId, parameterId, value):
  1229. self.lib.carla_set_parameter_value(pluginId, parameterId, value)
  1230. # Change a plugin's parameter MIDI cc.
  1231. # @param pluginId Plugin
  1232. # @param parameterId Parameter index
  1233. # @param cc New MIDI cc
  1234. def set_parameter_midi_channel(self, pluginId, parameterId, channel):
  1235. self.lib.carla_set_parameter_midi_channel(pluginId, parameterId, channel)
  1236. # Change a plugin's parameter MIDI channel.
  1237. # @param pluginId Plugin
  1238. # @param parameterId Parameter index
  1239. # @param channel New MIDI channel
  1240. def set_parameter_midi_cc(self, pluginId, parameterId, cc):
  1241. self.lib.carla_set_parameter_midi_cc(pluginId, parameterId, cc)
  1242. # Change a plugin's current program.
  1243. # @param pluginId Plugin
  1244. # @param programId New program
  1245. def set_program(self, pluginId, programId):
  1246. self.lib.carla_set_program(pluginId, programId)
  1247. # Change a plugin's current MIDI program.
  1248. # @param pluginId Plugin
  1249. # @param midiProgramId New value
  1250. def set_midi_program(self, pluginId, midiProgramId):
  1251. self.lib.carla_set_midi_program(pluginId, midiProgramId)
  1252. # Set a plugin's custom data set.
  1253. # @param pluginId Plugin
  1254. # @param type Type
  1255. # @param key Key
  1256. # @param value New value
  1257. # @see CustomDataTypes and CustomDataKeys
  1258. def set_custom_data(self, pluginId, type_, key, value):
  1259. self.lib.carla_set_custom_data(pluginId, type_.encode("utf-8"), key.encode("utf-8"), value.encode("utf-8"))
  1260. # Set a plugin's chunk data.
  1261. # @param pluginId Plugin
  1262. # @param value New value
  1263. # @see PLUGIN_OPTION_USE_CHUNKS and carla_get_chunk_data()
  1264. def set_chunk_data(self, pluginId, chunkData):
  1265. self.lib.carla_set_chunk_data(pluginId, chunkData.encode("utf-8"))
  1266. # Tell a plugin to prepare for save.\n
  1267. # This should be called before saving custom data sets.
  1268. # @param pluginId Plugin
  1269. def prepare_for_save(self, pluginId):
  1270. self.lib.carla_prepare_for_save(pluginId)
  1271. # Send a single note of a plugin.\n
  1272. # If velocity is 0, note-off is sent; note-on otherwise.
  1273. # @param pluginId Plugin
  1274. # @param channel Note channel
  1275. # @param note Note pitch
  1276. # @param velocity Note velocity
  1277. def send_midi_note(self, pluginId, channel, note, velocity):
  1278. self.lib.carla_send_midi_note(pluginId, channel, note, velocity)
  1279. # Tell a plugin to show its own custom UI.
  1280. # @param pluginId Plugin
  1281. # @param yesNo New UI state, visible or not
  1282. # @see PLUGIN_HAS_CUSTOM_UI
  1283. def show_custom_ui(self, pluginId, yesNo):
  1284. self.lib.carla_show_custom_ui(pluginId, yesNo)
  1285. # Get the current engine buffer size.
  1286. def get_buffer_size(self):
  1287. return int(self.lib.carla_get_buffer_size())
  1288. # Get the current engine sample rate.
  1289. def get_sample_rate(self):
  1290. return float(self.lib.carla_get_sample_rate())
  1291. # Get the last error.
  1292. def get_last_error(self):
  1293. return charPtrToString(self.lib.carla_get_last_error())
  1294. # Get the current engine OSC URL (TCP).
  1295. def get_host_osc_url_tcp(self):
  1296. return charPtrToString(self.lib.carla_get_host_osc_url_tcp())
  1297. # Get the current engine OSC URL (UDP).
  1298. def get_host_osc_url_udp(self):
  1299. return charPtrToString(self.lib.carla_get_host_osc_url_udp())
  1300. def _init(self, libName):
  1301. self.lib = cdll.LoadLibrary(libName)
  1302. self.lib.carla_get_complete_license_text.argtypes = None
  1303. self.lib.carla_get_complete_license_text.restype = c_char_p
  1304. self.lib.carla_get_supported_file_extensions.argtypes = None
  1305. self.lib.carla_get_supported_file_extensions.restype = c_char_p
  1306. self.lib.carla_get_engine_driver_count.argtypes = None
  1307. self.lib.carla_get_engine_driver_count.restype = c_uint
  1308. self.lib.carla_get_engine_driver_name.argtypes = [c_uint]
  1309. self.lib.carla_get_engine_driver_name.restype = c_char_p
  1310. self.lib.carla_get_engine_driver_device_names.argtypes = [c_uint]
  1311. self.lib.carla_get_engine_driver_device_names.restype = POINTER(c_char_p)
  1312. self.lib.carla_get_engine_driver_device_info.argtypes = [c_uint, c_char_p]
  1313. self.lib.carla_get_engine_driver_device_info.restype = POINTER(EngineDriverDeviceInfo)
  1314. self.lib.carla_get_internal_plugin_count.argtypes = None
  1315. self.lib.carla_get_internal_plugin_count.restype = c_uint
  1316. self.lib.carla_get_internal_plugin_info.argtypes = [c_uint]
  1317. self.lib.carla_get_internal_plugin_info.restype = POINTER(CarlaNativePluginInfo)
  1318. self.lib.carla_engine_init.argtypes = [c_char_p, c_char_p]
  1319. self.lib.carla_engine_init.restype = c_bool
  1320. self.lib.carla_engine_close.argtypes = None
  1321. self.lib.carla_engine_close.restype = c_bool
  1322. self.lib.carla_engine_idle.argtypes = None
  1323. self.lib.carla_engine_idle.restype = None
  1324. self.lib.carla_is_engine_running.argtypes = None
  1325. self.lib.carla_is_engine_running.restype = c_bool
  1326. self.lib.carla_set_engine_about_to_close.argtypes = None
  1327. self.lib.carla_set_engine_about_to_close.restype = None
  1328. self.lib.carla_set_engine_callback.argtypes = [EngineCallbackFunc, c_void_p]
  1329. self.lib.carla_set_engine_callback.restype = None
  1330. self.lib.carla_set_engine_option.argtypes = [c_enum, c_int, c_char_p]
  1331. self.lib.carla_set_engine_option.restype = None
  1332. self.lib.carla_set_file_callback.argtypes = [FileCallbackFunc, c_void_p]
  1333. self.lib.carla_set_file_callback.restype = None
  1334. self.lib.carla_load_file.argtypes = [c_char_p]
  1335. self.lib.carla_load_file.restype = c_bool
  1336. self.lib.carla_load_project.argtypes = [c_char_p]
  1337. self.lib.carla_load_project.restype = c_bool
  1338. self.lib.carla_save_project.argtypes = [c_char_p]
  1339. self.lib.carla_save_project.restype = c_bool
  1340. self.lib.carla_patchbay_connect.argtypes = [c_int, c_int]
  1341. self.lib.carla_patchbay_connect.restype = c_bool
  1342. self.lib.carla_patchbay_disconnect.argtypes = [c_int]
  1343. self.lib.carla_patchbay_disconnect.restype = c_bool
  1344. self.lib.carla_patchbay_refresh.argtypes = None
  1345. self.lib.carla_patchbay_refresh.restype = c_bool
  1346. self.lib.carla_transport_play.argtypes = None
  1347. self.lib.carla_transport_play.restype = None
  1348. self.lib.carla_transport_pause.argtypes = None
  1349. self.lib.carla_transport_pause.restype = None
  1350. self.lib.carla_transport_relocate.argtypes = [c_uint64]
  1351. self.lib.carla_transport_relocate.restype = None
  1352. self.lib.carla_get_current_transport_frame.argtypes = None
  1353. self.lib.carla_get_current_transport_frame.restype = c_uint64
  1354. self.lib.carla_get_transport_info.argtypes = None
  1355. self.lib.carla_get_transport_info.restype = POINTER(CarlaTransportInfo)
  1356. self.lib.carla_add_plugin.argtypes = [c_enum, c_enum, c_char_p, c_char_p, c_char_p, c_void_p]
  1357. self.lib.carla_add_plugin.restype = c_bool
  1358. self.lib.carla_remove_plugin.argtypes = [c_uint]
  1359. self.lib.carla_remove_plugin.restype = c_bool
  1360. self.lib.carla_remove_all_plugins.argtypes = None
  1361. self.lib.carla_remove_all_plugins.restype = c_bool
  1362. self.lib.carla_rename_plugin.argtypes = [c_uint, c_char_p]
  1363. self.lib.carla_rename_plugin.restype = c_char_p
  1364. self.lib.carla_clone_plugin.argtypes = [c_uint]
  1365. self.lib.carla_clone_plugin.restype = c_bool
  1366. self.lib.carla_replace_plugin.argtypes = [c_uint]
  1367. self.lib.carla_replace_plugin.restype = c_bool
  1368. self.lib.carla_switch_plugins.argtypes = [c_uint, c_uint]
  1369. self.lib.carla_switch_plugins.restype = c_bool
  1370. self.lib.carla_load_plugin_state.argtypes = [c_uint, c_char_p]
  1371. self.lib.carla_load_plugin_state.restype = c_bool
  1372. self.lib.carla_save_plugin_state.argtypes = [c_uint, c_char_p]
  1373. self.lib.carla_save_plugin_state.restype = c_bool
  1374. self.lib.carla_get_plugin_info.argtypes = [c_uint]
  1375. self.lib.carla_get_plugin_info.restype = POINTER(CarlaPluginInfo)
  1376. self.lib.carla_get_audio_port_count_info.argtypes = [c_uint]
  1377. self.lib.carla_get_audio_port_count_info.restype = POINTER(CarlaPortCountInfo)
  1378. self.lib.carla_get_midi_port_count_info.argtypes = [c_uint]
  1379. self.lib.carla_get_midi_port_count_info.restype = POINTER(CarlaPortCountInfo)
  1380. self.lib.carla_get_parameter_count_info.argtypes = [c_uint]
  1381. self.lib.carla_get_parameter_count_info.restype = POINTER(CarlaPortCountInfo)
  1382. self.lib.carla_get_parameter_info.argtypes = [c_uint, c_uint32]
  1383. self.lib.carla_get_parameter_info.restype = POINTER(CarlaParameterInfo)
  1384. self.lib.carla_get_parameter_scalepoint_info.argtypes = [c_uint, c_uint32, c_uint32]
  1385. self.lib.carla_get_parameter_scalepoint_info.restype = POINTER(CarlaScalePointInfo)
  1386. self.lib.carla_get_parameter_data.argtypes = [c_uint, c_uint32]
  1387. self.lib.carla_get_parameter_data.restype = POINTER(ParameterData)
  1388. self.lib.carla_get_parameter_ranges.argtypes = [c_uint, c_uint32]
  1389. self.lib.carla_get_parameter_ranges.restype = POINTER(ParameterRanges)
  1390. self.lib.carla_get_midi_program_data.argtypes = [c_uint, c_uint32]
  1391. self.lib.carla_get_midi_program_data.restype = POINTER(MidiProgramData)
  1392. self.lib.carla_get_custom_data.argtypes = [c_uint, c_uint32]
  1393. self.lib.carla_get_custom_data.restype = POINTER(CustomData)
  1394. self.lib.carla_get_chunk_data.argtypes = [c_uint]
  1395. self.lib.carla_get_chunk_data.restype = c_char_p
  1396. self.lib.carla_get_parameter_count.argtypes = [c_uint]
  1397. self.lib.carla_get_parameter_count.restype = c_uint32
  1398. self.lib.carla_get_program_count.argtypes = [c_uint]
  1399. self.lib.carla_get_program_count.restype = c_uint32
  1400. self.lib.carla_get_midi_program_count.argtypes = [c_uint]
  1401. self.lib.carla_get_midi_program_count.restype = c_uint32
  1402. self.lib.carla_get_custom_data_count.argtypes = [c_uint]
  1403. self.lib.carla_get_custom_data_count.restype = c_uint32
  1404. self.lib.carla_get_parameter_text.argtypes = [c_uint, c_uint32]
  1405. self.lib.carla_get_parameter_text.restype = c_char_p
  1406. self.lib.carla_get_program_name.argtypes = [c_uint, c_uint32]
  1407. self.lib.carla_get_program_name.restype = c_char_p
  1408. self.lib.carla_get_midi_program_name.argtypes = [c_uint, c_uint32]
  1409. self.lib.carla_get_midi_program_name.restype = c_char_p
  1410. self.lib.carla_get_real_plugin_name.argtypes = [c_uint]
  1411. self.lib.carla_get_real_plugin_name.restype = c_char_p
  1412. self.lib.carla_get_current_program_index.argtypes = [c_uint]
  1413. self.lib.carla_get_current_program_index.restype = c_int32
  1414. self.lib.carla_get_current_midi_program_index.argtypes = [c_uint]
  1415. self.lib.carla_get_current_midi_program_index.restype = c_int32
  1416. self.lib.carla_get_default_parameter_value.argtypes = [c_uint, c_uint32]
  1417. self.lib.carla_get_default_parameter_value.restype = c_float
  1418. self.lib.carla_get_current_parameter_value.argtypes = [c_uint, c_uint32]
  1419. self.lib.carla_get_current_parameter_value.restype = c_float
  1420. self.lib.carla_get_input_peak_value.argtypes = [c_uint, c_bool]
  1421. self.lib.carla_get_input_peak_value.restype = c_float
  1422. self.lib.carla_get_output_peak_value.argtypes = [c_uint, c_bool]
  1423. self.lib.carla_get_output_peak_value.restype = c_float
  1424. self.lib.carla_set_option.argtypes = [c_uint, c_uint, c_bool]
  1425. self.lib.carla_set_option.restype = None
  1426. self.lib.carla_set_active.argtypes = [c_uint, c_bool]
  1427. self.lib.carla_set_active.restype = None
  1428. self.lib.carla_set_drywet.argtypes = [c_uint, c_float]
  1429. self.lib.carla_set_drywet.restype = None
  1430. self.lib.carla_set_volume.argtypes = [c_uint, c_float]
  1431. self.lib.carla_set_volume.restype = None
  1432. self.lib.carla_set_balance_left.argtypes = [c_uint, c_float]
  1433. self.lib.carla_set_balance_left.restype = None
  1434. self.lib.carla_set_balance_right.argtypes = [c_uint, c_float]
  1435. self.lib.carla_set_balance_right.restype = None
  1436. self.lib.carla_set_panning.argtypes = [c_uint, c_float]
  1437. self.lib.carla_set_panning.restype = None
  1438. self.lib.carla_set_ctrl_channel.argtypes = [c_uint, c_int8]
  1439. self.lib.carla_set_ctrl_channel.restype = None
  1440. self.lib.carla_set_parameter_value.argtypes = [c_uint, c_uint32, c_float]
  1441. self.lib.carla_set_parameter_value.restype = None
  1442. self.lib.carla_set_parameter_midi_channel.argtypes = [c_uint, c_uint32, c_uint8]
  1443. self.lib.carla_set_parameter_midi_channel.restype = None
  1444. self.lib.carla_set_parameter_midi_cc.argtypes = [c_uint, c_uint32, c_int16]
  1445. self.lib.carla_set_parameter_midi_cc.restype = None
  1446. self.lib.carla_set_program.argtypes = [c_uint, c_uint32]
  1447. self.lib.carla_set_program.restype = None
  1448. self.lib.carla_set_midi_program.argtypes = [c_uint, c_uint32]
  1449. self.lib.carla_set_midi_program.restype = None
  1450. self.lib.carla_set_custom_data.argtypes = [c_uint, c_char_p, c_char_p, c_char_p]
  1451. self.lib.carla_set_custom_data.restype = None
  1452. self.lib.carla_set_chunk_data.argtypes = [c_uint, c_char_p]
  1453. self.lib.carla_set_chunk_data.restype = None
  1454. self.lib.carla_prepare_for_save.argtypes = [c_uint]
  1455. self.lib.carla_prepare_for_save.restype = None
  1456. self.lib.carla_send_midi_note.argtypes = [c_uint, c_uint8, c_uint8, c_uint8]
  1457. self.lib.carla_send_midi_note.restype = None
  1458. self.lib.carla_show_custom_ui.argtypes = [c_uint, c_bool]
  1459. self.lib.carla_show_custom_ui.restype = None
  1460. self.lib.carla_get_buffer_size.argtypes = None
  1461. self.lib.carla_get_buffer_size.restype = c_uint32
  1462. self.lib.carla_get_sample_rate.argtypes = None
  1463. self.lib.carla_get_sample_rate.restype = c_double
  1464. self.lib.carla_get_last_error.argtypes = None
  1465. self.lib.carla_get_last_error.restype = c_char_p
  1466. self.lib.carla_get_host_osc_url_tcp.argtypes = None
  1467. self.lib.carla_get_host_osc_url_tcp.restype = c_char_p
  1468. self.lib.carla_get_host_osc_url_udp.argtypes = None
  1469. self.lib.carla_get_host_osc_url_udp.restype = c_char_p