simple-carla 2.1.3__tar.gz → 2.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {simple_carla-2.1.3 → simple_carla-2.3.1}/PKG-INFO +1 -1
- {simple_carla-2.1.3 → simple_carla-2.3.1}/pyproject.toml +1 -1
- {simple_carla-2.1.3 → simple_carla-2.3.1}/simple_carla/__init__.py +72 -42
- {simple_carla-2.1.3 → simple_carla-2.3.1}/tests/carla.py +5 -8
- {simple_carla-2.1.3 → simple_carla-2.3.1}/.gitignore +0 -0
- {simple_carla-2.1.3 → simple_carla-2.3.1}/LICENSE +0 -0
- {simple_carla-2.1.3 → simple_carla-2.3.1}/README.md +0 -0
- {simple_carla-2.1.3 → simple_carla-2.3.1}/simple_carla/plugin_dialog.py +0 -0
- {simple_carla-2.1.3 → simple_carla-2.3.1}/simple_carla/qt.py +0 -0
- {simple_carla-2.1.3 → simple_carla-2.3.1}/simple_carla/scripts/__init__.py +0 -0
- {simple_carla-2.1.3 → simple_carla-2.3.1}/simple_carla/scripts/sc_plugin_def.py +0 -0
- {simple_carla-2.1.3 → simple_carla-2.3.1}/tests/qt_carla.py +0 -0
@@ -18,7 +18,7 @@ build-backend = "flit_core.buildapi"
|
|
18
18
|
sc-plugin-def = "simple_carla.scripts.sc_plugin_def:main"
|
19
19
|
|
20
20
|
[bumpver]
|
21
|
-
current_version = "2.1
|
21
|
+
current_version = "2.3.1"
|
22
22
|
version_pattern = "MAJOR.MINOR.PATCH"
|
23
23
|
commit_message = "Bump version {old_version} -> {new_version}"
|
24
24
|
commit = true
|
@@ -240,7 +240,7 @@ from carla_backend import (
|
|
240
240
|
)
|
241
241
|
|
242
242
|
|
243
|
-
__version__ = "2.1
|
243
|
+
__version__ = "2.3.1"
|
244
244
|
|
245
245
|
|
246
246
|
# -------------------------------------------------------------------
|
@@ -286,7 +286,7 @@ class _SimpleCarla(CarlaHostDLL):
|
|
286
286
|
Inherited by: Carla, CarlaQt
|
287
287
|
"""
|
288
288
|
|
289
|
-
idle_interval = 1 /
|
289
|
+
idle_interval = 1 / 20
|
290
290
|
instance = None
|
291
291
|
client_name = None
|
292
292
|
_autoload_plugin = None
|
@@ -310,9 +310,10 @@ class _SimpleCarla(CarlaHostDLL):
|
|
310
310
|
self._plugins = {} # Plugin, indexed on Carla -generated "plugin_id"
|
311
311
|
self._clients = {} # PatchbayClient, indexed on Carla -generated "client_id"
|
312
312
|
self._sys_clients = {} # SystemPatchbayClient, indexed on "client_name"
|
313
|
-
self._connections = {} # PatchbayConnection,
|
314
|
-
|
315
|
-
self.
|
313
|
+
self._connections = {} # PatchbayConnection,
|
314
|
+
# indexed on Carla -generated "connection_id"
|
315
|
+
self._plugin_by_uuid = {} # Plugin, indexed on "unique_name",
|
316
|
+
# used for identifying plugin during instantiation
|
316
317
|
libname = "libcarla_standalone2.so"
|
317
318
|
CarlaHostDLL.__init__(self, os.path.join(carla_binaries_path, libname), False)
|
318
319
|
|
@@ -1281,13 +1282,14 @@ class _SimpleCarla(CarlaHostDLL):
|
|
1281
1282
|
def cb_plugin_added(self, plugin_id, plugin_type, carla_plugin_name):
|
1282
1283
|
"""
|
1283
1284
|
After Carla adds a plugin, it signals this with an assigned plugin_id. This
|
1284
|
-
function uses the
|
1285
|
+
function uses the unique_name given to the Plugin by this class to retrieve the
|
1285
1286
|
plugin from the "_plugin_by_uuid" dict, and add the association with the plugin_id in
|
1286
1287
|
the "_plugins" dict.
|
1287
1288
|
"""
|
1288
1289
|
if plugin_id in self._plugins:
|
1289
1290
|
logging.error('cb_plugin_added: Cannot add plugin %s', plugin_id)
|
1290
|
-
logging.error('"%s" - plugin %s already in _plugins"',
|
1291
|
+
logging.error('"%s" - plugin %s already in _plugins"',
|
1292
|
+
carla_plugin_name, self._plugins[plugin_id])
|
1291
1293
|
return
|
1292
1294
|
if carla_plugin_name in self._plugin_by_uuid:
|
1293
1295
|
self._plugins[plugin_id] = self._plugin_by_uuid[carla_plugin_name]
|
@@ -1299,11 +1301,11 @@ class _SimpleCarla(CarlaHostDLL):
|
|
1299
1301
|
def cb_plugin_removed(self, plugin_id):
|
1300
1302
|
if plugin_id in self._plugins:
|
1301
1303
|
plugin = self._plugins[plugin_id]
|
1302
|
-
if plugin.
|
1303
|
-
del self._plugin_by_uuid[plugin.
|
1304
|
+
if plugin.unique_name in self._plugin_by_uuid:
|
1305
|
+
del self._plugin_by_uuid[plugin.unique_name]
|
1304
1306
|
else:
|
1305
|
-
logging.error('cb_plugin_removed: "%s"
|
1306
|
-
plugin, plugin.
|
1307
|
+
logging.error('cb_plugin_removed: "%s" unique_name %s not in self._plugin_by_uuid',
|
1308
|
+
plugin, plugin.unique_name)
|
1307
1309
|
self._alert_plugin_removed(plugin)
|
1308
1310
|
# Renumber plugins per Carla plugin_id conventions:
|
1309
1311
|
for i in range(plugin_id, len(self._plugins) - 1):
|
@@ -1512,14 +1514,14 @@ class _SimpleCarla(CarlaHostDLL):
|
|
1512
1514
|
# ================================================================================
|
1513
1515
|
|
1514
1516
|
def add_plugin(self, plugin):
|
1515
|
-
self._plugin_by_uuid[plugin.
|
1517
|
+
self._plugin_by_uuid[plugin.unique_name] = plugin
|
1516
1518
|
if self.is_engine_running():
|
1517
1519
|
if not self._add_plugin( # Carla parameter
|
1518
1520
|
# ----------------------------------------- # ---------------
|
1519
1521
|
plugin.plugin_def['build'], # btype
|
1520
1522
|
plugin.plugin_def['type'], # ptype
|
1521
1523
|
plugin.plugin_def['filename'], # filename
|
1522
|
-
plugin.
|
1524
|
+
plugin.unique_name, # name
|
1523
1525
|
plugin.plugin_def['label'], # label
|
1524
1526
|
int(plugin.plugin_def['uniqueId'] or 0), # uniqueId
|
1525
1527
|
None, # extraPtr
|
@@ -1553,12 +1555,12 @@ class _SimpleCarla(CarlaHostDLL):
|
|
1553
1555
|
return self._plugins[plugin_id]
|
1554
1556
|
raise IndexError()
|
1555
1557
|
|
1556
|
-
def plugin_from_uuid(self,
|
1558
|
+
def plugin_from_uuid(self, unique_name):
|
1557
1559
|
"""
|
1558
1560
|
Returns plugin.
|
1559
|
-
"
|
1561
|
+
"unique_name" is the unique_name property of a Plugin object, generated by this class.
|
1560
1562
|
"""
|
1561
|
-
return self._plugin_by_uuid[
|
1563
|
+
return self._plugin_by_uuid[unique_name] if unique_name in self._plugin_by_uuid else None
|
1562
1564
|
|
1563
1565
|
def client(self, client_id):
|
1564
1566
|
"""
|
@@ -1705,7 +1707,7 @@ class _SimpleCarla(CarlaHostDLL):
|
|
1705
1707
|
"""
|
1706
1708
|
if not self.patchbay_connect(True, port1.client_id, port1.port_id,
|
1707
1709
|
port2.client_id, port2.port_id):
|
1708
|
-
|
1710
|
+
raise RuntimeError('Patchbay connect FAILED! %s -> %s', port1, port2)
|
1709
1711
|
|
1710
1712
|
# -------------------------------------------------------------------
|
1711
1713
|
# Plugin filename autoload trick
|
@@ -1793,26 +1795,21 @@ class _SimpleCarla(CarlaHostDLL):
|
|
1793
1795
|
return None
|
1794
1796
|
|
1795
1797
|
# -------------------------------------------------------------------
|
1796
|
-
# Plugin autogenerate
|
1798
|
+
# Plugin autogenerate unique_name / moniker helper
|
1797
1799
|
|
1798
|
-
def
|
1800
|
+
def get_unique_name(self, plugin):
|
1799
1801
|
"""
|
1800
|
-
|
1801
|
-
identification, and a unique "moniker" for human-readable identification.
|
1802
|
+
Generates a "unique_name" string for internal plugin identification.
|
1802
1803
|
"""
|
1803
|
-
|
1804
|
-
plugin.uuid = '%03d' % self._uuid
|
1805
|
-
while plugin.uuid in self._plugin_by_uuid:
|
1806
|
-
self._uuid += 1
|
1807
|
-
plugin.uuid = '%03d' % self._uuid
|
1808
|
-
monikers = [ existing_plugin.moniker \
|
1804
|
+
unique_names = [ existing_plugin.unique_name \
|
1809
1805
|
for existing_plugin in self._plugin_by_uuid.values() \
|
1810
1806
|
if existing_plugin.original_plugin_name == plugin.original_plugin_name ]
|
1811
|
-
idx = 1
|
1812
|
-
|
1813
|
-
while
|
1807
|
+
idx = len(unique_names) + 1
|
1808
|
+
unique_name = f'{plugin.original_plugin_name} {idx}'
|
1809
|
+
while unique_name in unique_names:
|
1814
1810
|
idx += 1
|
1815
|
-
|
1811
|
+
unique_name = f'{plugin.original_plugin_name} {idx}'
|
1812
|
+
return unique_name
|
1816
1813
|
|
1817
1814
|
|
1818
1815
|
class Carla(_SimpleCarla):
|
@@ -2385,6 +2382,22 @@ class PatchbayClient:
|
|
2385
2382
|
"""
|
2386
2383
|
return self._exclusive_clients(self.input_ports())
|
2387
2384
|
|
2385
|
+
def audio_input_clients(self):
|
2386
|
+
"""
|
2387
|
+
Returns list of PatchbayClient.
|
2388
|
+
Return all clients which are connected to all of this PatchbayClient's audio input ports.
|
2389
|
+
(May return classes extending PatchbayClient, i.e. SystemPatchbayClient / Plugin)
|
2390
|
+
"""
|
2391
|
+
return self._exclusive_clients(self.audio_ins())
|
2392
|
+
|
2393
|
+
def midi_input_clients(self):
|
2394
|
+
"""
|
2395
|
+
Returns list of PatchbayClient.
|
2396
|
+
Return all clients which are connected to all of this PatchbayClient's midi input ports.
|
2397
|
+
(May return classes extending PatchbayClient, i.e. SystemPatchbayClient / Plugin)
|
2398
|
+
"""
|
2399
|
+
return self._exclusive_clients(self.midi_ins())
|
2400
|
+
|
2388
2401
|
def output_clients(self):
|
2389
2402
|
"""
|
2390
2403
|
Returns list of PatchbayClient.
|
@@ -2393,11 +2406,27 @@ class PatchbayClient:
|
|
2393
2406
|
"""
|
2394
2407
|
return self._exclusive_clients(self.output_ports())
|
2395
2408
|
|
2409
|
+
def audio_output_clients(self):
|
2410
|
+
"""
|
2411
|
+
Returns list of PatchbayClient.
|
2412
|
+
Return all clients which are connected to all of this PatchbayClient's audio output ports.
|
2413
|
+
(May return classes extending PatchbayClient, i.e. SystemPatchbayClient / Plugin)
|
2414
|
+
"""
|
2415
|
+
return self._exclusive_clients(self.audio_outs())
|
2416
|
+
|
2417
|
+
def midi_output_clients(self):
|
2418
|
+
"""
|
2419
|
+
Returns list of PatchbayClient.
|
2420
|
+
Return all clients which are connected to all of this PatchbayClient's midi output ports.
|
2421
|
+
(May return classes extending PatchbayClient, i.e. SystemPatchbayClient / Plugin)
|
2422
|
+
"""
|
2423
|
+
return self._exclusive_clients(self.midi_outs())
|
2424
|
+
|
2396
2425
|
def _exclusive_clients(self, ports):
|
2397
2426
|
"""
|
2398
2427
|
Returns list of PatchbayClient.
|
2399
2428
|
Implements the reduction of port clients to an exlusive set.
|
2400
|
-
Used by
|
2429
|
+
Used by "input_clients", "audio_input_clients", "output_clients", etc.
|
2401
2430
|
"""
|
2402
2431
|
return list(set( [
|
2403
2432
|
client \
|
@@ -2685,7 +2714,7 @@ class Plugin(PatchbayClient):
|
|
2685
2714
|
_cb_ready = None
|
2686
2715
|
_cb_removed = None
|
2687
2716
|
|
2688
|
-
_save_state_keys = [ '
|
2717
|
+
_save_state_keys = [ 'unique_name', 'moniker',
|
2689
2718
|
'active', 'volume', 'dry_wet', 'panning', 'balance_left', 'balance_right',
|
2690
2719
|
'prefer_generic_dialog', 'send_all_sound_off', 'send_channel_pressure', 'send_control_changes',
|
2691
2720
|
'send_note_aftertouch', 'send_pitchbend', 'send_program_changes', 'skip_sending_notes', 'force_stereo' ]
|
@@ -2732,11 +2761,8 @@ class Plugin(PatchbayClient):
|
|
2732
2761
|
self.parameters = {} # Parameter objects. Key is parameter_id.
|
2733
2762
|
self._midi_notes = np_zeros((16, 128), dtype=bool) # array for determining whether midi active.
|
2734
2763
|
|
2735
|
-
|
2736
|
-
|
2737
|
-
else:
|
2738
|
-
self.uuid = saved_state["vars"]["uuid"]
|
2739
|
-
self.moniker = saved_state["vars"]["moniker"]
|
2764
|
+
self.unique_name = Carla.instance.get_unique_name(self)
|
2765
|
+
self.moniker = self.unique_name if saved_state is None else saved_state["vars"]["moniker"]
|
2740
2766
|
|
2741
2767
|
def add_to_carla(self):
|
2742
2768
|
"""
|
@@ -3011,8 +3037,7 @@ class Plugin(PatchbayClient):
|
|
3011
3037
|
# Str
|
3012
3038
|
|
3013
3039
|
def __str__(self):
|
3014
|
-
return '<{
|
3015
|
-
type(self).__name__, self.moniker, self.uuid, self.client_id)
|
3040
|
+
return f'<{type(self).__name__} "{self.unique_name}" (client_id {self.client_id})>'
|
3016
3041
|
|
3017
3042
|
# -------------------------------------------------------------------
|
3018
3043
|
# Functions called from Carla engine callbacks:
|
@@ -3482,8 +3507,13 @@ class Parameter:
|
|
3482
3507
|
return '<Parameter [{0}] "{1}" {2} {3} value: {4}>'.format(
|
3483
3508
|
self.index,
|
3484
3509
|
self.name,
|
3485
|
-
("input" if self.is_input
|
3486
|
-
|
3510
|
+
("input" if self.is_input \
|
3511
|
+
else "output" if self.is_output \
|
3512
|
+
else "unused"),
|
3513
|
+
("integer" if self.is_integer \
|
3514
|
+
else "Bool" if self.is_boolean \
|
3515
|
+
else "log" if self.is_logarithmic \
|
3516
|
+
else "float"),
|
3487
3517
|
self.__value
|
3488
3518
|
)
|
3489
3519
|
|
@@ -19,13 +19,13 @@ class TestApp:
|
|
19
19
|
carla.on_engine_started(self.carla_started)
|
20
20
|
carla.on_engine_stopped(self.carla_stopped)
|
21
21
|
if not carla.engine_init():
|
22
|
-
|
23
|
-
if
|
24
|
-
raise Exception("Could not
|
22
|
+
audio_error = carla.get_last_error()
|
23
|
+
if audio_error:
|
24
|
+
raise Exception("Could not start carla; possible reasons:\n%s" % audio_error)
|
25
25
|
else:
|
26
|
-
raise Exception('Could not
|
26
|
+
raise Exception('Could not start carla')
|
27
27
|
|
28
|
-
def carla_started(self,
|
28
|
+
def carla_started(self, *_):
|
29
29
|
logging.debug('======= Engine started ======== ')
|
30
30
|
self.meter = EBUMeter()
|
31
31
|
self.meter.on_ready(self.meter_ready)
|
@@ -40,9 +40,6 @@ class TestApp:
|
|
40
40
|
assert(Carla.instance is Carla(APPLICATION_NAME))
|
41
41
|
|
42
42
|
def wait_ready(self):
|
43
|
-
"""
|
44
|
-
Blocks until sig_ready received from MeteringWorker.
|
45
|
-
"""
|
46
43
|
watchdog = 0
|
47
44
|
while not self.ready:
|
48
45
|
watchdog += 1
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|