csoundengine 2.22.6__tar.gz → 2.23.0__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.
- {csoundengine-2.22.6 → csoundengine-2.23.0}/PKG-INFO +2 -2
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/csoundlib.py +10 -26
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/dependencies.py +0 -15
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/engine.py +13 -2
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/enginebase.py +3 -4
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/instr.py +3 -6
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/offlineengine.py +14 -2
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/schedevent.py +7 -6
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/synth.py +6 -5
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine.egg-info/PKG-INFO +2 -2
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine.egg-info/requires.txt +1 -1
- {csoundengine-2.22.6 → csoundengine-2.23.0}/pyproject.toml +2 -2
- {csoundengine-2.22.6 → csoundengine-2.23.0}/.cirrus.yml +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/.github/workflows/test2.yml +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/.gitignore +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/LICENSE.txt +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/MANIFEST.in +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/README.rst +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/cmake/csound-custom-macos.cmake +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/__init__.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/_common.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/_palette.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/abstractrenderer.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/baseschedevent.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/busproxy.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/config.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/contants.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/csd.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/csounddefs.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/csoundparse.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/engineorc.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/errors.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/event.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/instrtools.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/interact.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/internal.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/jacktools.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/jupytertools.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/linuxaudio.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/magic.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/offline.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/offlineorc.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/paramtable.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/plotting.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/py.typed +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/renderjob.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/session.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/sessionhandler.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/sessioninstrs.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/sftools.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/state.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/tableproxy.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine/tools.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine.egg-info/SOURCES.txt +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine.egg-info/dependency_links.txt +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/csoundengine.egg-info/top_level.txt +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/Builtin-Opcodes.rst +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/Installation.rst +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/Introduction.rst +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/Makefile +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/Reference.rst +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/_static/custom.css +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/_static/offlineengine-example1.mp3 +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/assets/config-edit.png +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/assets/eventui.png +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/assets/eventui2.png +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/assets/jupyter-config.png +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/assets/jupyter-plotTable.png +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/assets/jupyter-session-1.png +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/assets/offlineengine-example1.png +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/assets/select-preset.png +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/assets/synthui.png +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/assets/tableplot-sine.png +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/assets/tableplot-stereo.png +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/assets/tableproxy-plot.png +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/assets/tableproxy-plotspectrogram.png +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/assets/ui2.png +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/conf.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/config.rst +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/configkeys.rst +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/csoundengine.rst +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/csoundlib.rst +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/index.rst +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/instr.rst +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/jupyternotebook.rst +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/magics.rst +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/make.bat +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/offline.rst +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/offlineengine.rst +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/offlineengine_example.inc +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/offlineengine_example2.inc +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/offlinerenderer.rst +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/renderjob.rst +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/requirements.txt +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/schedevent.rst +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/session.rst +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/synth.rst +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/docs/tables.rst +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/notebooks/buses.ipynb +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/notebooks/offlineengine-playback.ipynb +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/notebooks/offlineengine.ipynb +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/notebooks/snd/colours-german-male.flac +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/notebooks/snd/piano-pitchtest-2.flac +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/notebooks/snd/voiceover-fragment-48k.flac +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/notebooks/test/plltrack.ipynb +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/notebooks/test/test-bus.ipynb +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/notebooks/test/test-dealloc-synth.ipynb +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/notebooks/test/test-delay.ipynb +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/notebooks/test/test-engine-params.ipynb +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/notebooks/test/test-libcsound.ipynb +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/notebooks/test/test-named-events.ipynb +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/notebooks/test/test-new-named-params.ipynb +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/notebooks/test/test-offline-render.ipynb +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/notebooks/test/test-offlinesession.ipynb +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/notebooks/test/test-params.ipynb +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/notebooks/test/test-playsample.ipynb +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/notebooks/test/test-stop.ipynb +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/notebooks/test/test-tight-scheduling.ipynb +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/notebooks/test/test-whenfinished.ipynb +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/notebooks/voice-pitch-track.ipynb +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/pyrightconfig.json +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/readthedocs.yml +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/scripts/download-plugins.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/scripts/update-config-docs.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/setup.cfg +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/test/importtime.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/test/libcsoundtest.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/test/simple.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/test/test1.csd +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/test/test1.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/test/test2.py +0 -0
- {csoundengine-2.22.6 → csoundengine-2.23.0}/test/testargs.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: csoundengine
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.23.0
|
|
4
4
|
Summary: An audio synthesis framework using csound
|
|
5
5
|
Author-email: Eduardo Moguillansky <eduardo.moguillansky@gmail.com>
|
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
|
@@ -695,7 +695,7 @@ Requires-Dist: ipywidgets
|
|
|
695
695
|
Requires-Dist: xxhash
|
|
696
696
|
Requires-Dist: docstring_parser
|
|
697
697
|
Requires-Dist: typing_extensions
|
|
698
|
-
Requires-Dist: libcsound>=0.
|
|
698
|
+
Requires-Dist: libcsound>=0.16.1
|
|
699
699
|
Requires-Dist: sndfileio>=2.1.1
|
|
700
700
|
Requires-Dist: emlib>=1.20
|
|
701
701
|
Requires-Dist: configdict>=2.10.0
|
|
@@ -48,7 +48,9 @@ _cache: dict[str, Any] = {
|
|
|
48
48
|
_audioDeviceRegex = r"(\d+):\s((?:adc|dac)\d+)\s*\((.*)\)(?:\s+\[ch:(\d+)\])?"
|
|
49
49
|
|
|
50
50
|
|
|
51
|
-
def midiDevices(backend='portmidi'
|
|
51
|
+
def midiDevices(backend='portmidi',
|
|
52
|
+
opcodedir=''
|
|
53
|
+
) -> tuple[list[MidiDevice], list[MidiDevice]]:
|
|
52
54
|
"""
|
|
53
55
|
Returns input and output midi devices for the given backend
|
|
54
56
|
|
|
@@ -71,7 +73,7 @@ def midiDevices(backend='portmidi') -> tuple[list[MidiDevice], list[MidiDevice]]
|
|
|
71
73
|
======== ===========================
|
|
72
74
|
"""
|
|
73
75
|
import libcsound
|
|
74
|
-
csound = libcsound.Csound()
|
|
76
|
+
csound = libcsound.Csound(opcodeDir=opcodedir)
|
|
75
77
|
csound.setOption(f"-+rtmidi={backend}")
|
|
76
78
|
csound.setOption("-odac")
|
|
77
79
|
csound.start()
|
|
@@ -146,7 +148,7 @@ class AudioBackend:
|
|
|
146
148
|
indevices, outdevices = getAudioDevices(backend=self.name)
|
|
147
149
|
return bool(indevices or outdevices)
|
|
148
150
|
|
|
149
|
-
def getSystemSr(self) -> int | None:
|
|
151
|
+
def getSystemSr(self, opcodedir='') -> int | None:
|
|
150
152
|
"""
|
|
151
153
|
Get the system samplerate for this backend, if available
|
|
152
154
|
|
|
@@ -156,7 +158,7 @@ class AudioBackend:
|
|
|
156
158
|
logger.debug(f"Backend {self.name} does not have a system sr, returning default")
|
|
157
159
|
return 44100
|
|
158
160
|
import libcsound
|
|
159
|
-
cs = libcsound.Csound()
|
|
161
|
+
cs = libcsound.Csound(opcodeDir=opcodedir)
|
|
160
162
|
cs.setOption("-odac")
|
|
161
163
|
cs.setOption(f"-+rtaudio={self.name}")
|
|
162
164
|
ok = cs.start()
|
|
@@ -176,7 +178,8 @@ class AudioBackend:
|
|
|
176
178
|
def audioDevices(self) -> tuple[list[AudioDevice], list[AudioDevice]]:
|
|
177
179
|
return self.audioDevicesViaAPI()
|
|
178
180
|
|
|
179
|
-
def audioDevicesViaAPI(self
|
|
181
|
+
def audioDevicesViaAPI(self, opcodedir=''
|
|
182
|
+
) -> tuple[list[AudioDevice], list[AudioDevice]]:
|
|
180
183
|
"""
|
|
181
184
|
Query csound for audio devices for this backend
|
|
182
185
|
|
|
@@ -185,7 +188,7 @@ class AudioBackend:
|
|
|
185
188
|
"""
|
|
186
189
|
logger.info(f"Querying csound's audio devices for backend {self.name}")
|
|
187
190
|
import libcsound
|
|
188
|
-
cs = libcsound.Csound()
|
|
191
|
+
cs = libcsound.Csound(opcodeDir=opcodedir)
|
|
189
192
|
cs.createMessageBuffer()
|
|
190
193
|
for opt in ['-+rtaudio='+self.name, "-m16", "-odac", "--use-system-sr"]:
|
|
191
194
|
cs.setOption(opt)
|
|
@@ -785,12 +788,10 @@ def installedOpcodes(cached=True, opcodedir: str = '') -> set[str]:
|
|
|
785
788
|
def _csoundGetInfoViaAPI(opcodedir='') -> dict:
|
|
786
789
|
global _cache
|
|
787
790
|
import libcsound
|
|
788
|
-
cs = libcsound.Csound()
|
|
791
|
+
cs = libcsound.Csound(opcodeDir=opcodedir)
|
|
789
792
|
cs.setOption("-d")
|
|
790
793
|
cs.setOption("--nosound")
|
|
791
794
|
cs.createMessageBuffer(echo=False)
|
|
792
|
-
if opcodedir:
|
|
793
|
-
cs.setOption(f'--opcode-dir={opcodedir}')
|
|
794
795
|
version = cs.version()
|
|
795
796
|
vs = str(version)
|
|
796
797
|
patch = int(vs[-1])
|
|
@@ -808,23 +809,6 @@ def _csoundGetInfoViaAPI(opcodedir='') -> dict:
|
|
|
808
809
|
'versionTriplet': versionTriplet}
|
|
809
810
|
|
|
810
811
|
|
|
811
|
-
# def _opcodesList(opcodedir='') -> list[str]:
|
|
812
|
-
# options = ["-z"]
|
|
813
|
-
# if opcodedir:
|
|
814
|
-
# options.append(f'--opcode-dir={opcodedir}')
|
|
815
|
-
# s = csoundSubproc(options)
|
|
816
|
-
# assert s.stderr is not None
|
|
817
|
-
# lines = s.stderr.readlines()
|
|
818
|
-
# allopcodes = []
|
|
819
|
-
# for line in lines:
|
|
820
|
-
# if line.startswith(b"end of score"):
|
|
821
|
-
# break
|
|
822
|
-
# opcodes = line.decode('utf8').split()
|
|
823
|
-
# if opcodes:
|
|
824
|
-
# allopcodes.extend(opcodes)
|
|
825
|
-
# return allopcodes
|
|
826
|
-
|
|
827
|
-
|
|
828
812
|
def saveAsGen23(data: Sequence[float] | np.ndarray,
|
|
829
813
|
outfile: str,
|
|
830
814
|
fmt="%.12f",
|
|
@@ -258,26 +258,11 @@ def installPlugins() -> bool:
|
|
|
258
258
|
logger.error(f"Exception {e} while trying to install plugins via risset")
|
|
259
259
|
return False
|
|
260
260
|
|
|
261
|
-
# logger.info("Installing plugins from distribution")
|
|
262
|
-
# try:
|
|
263
|
-
# _installPluginsFromDist(apiversion=majorversion)
|
|
264
|
-
# ok = pluginsInstalled(cached=False)
|
|
265
|
-
# if ok:
|
|
266
|
-
# logger.info("Plugins installed successfully from distribution")
|
|
267
|
-
# else:
|
|
268
|
-
# logger.error("Plugins where installed but do not seem to be detected")
|
|
269
|
-
# except Exception as e:
|
|
270
|
-
# logger.error(f"Exception {e} while trying to install plugins from distribution")
|
|
271
|
-
# return False
|
|
272
|
-
# return True
|
|
273
|
-
|
|
274
261
|
|
|
275
262
|
def _checkDependencies(fix=False, quiet=False) -> str:
|
|
276
263
|
"""
|
|
277
264
|
Returns an error message on failure, or an empty string on success
|
|
278
265
|
"""
|
|
279
|
-
if not csoundBinaryInPath():
|
|
280
|
-
logger.error("csound not found in the path. See https://csound.com/download.html. Some functionality might not be available")
|
|
281
266
|
from . import csoundlib
|
|
282
267
|
version = csoundlib.getVersion(useApi=True)
|
|
283
268
|
|
|
@@ -246,6 +246,16 @@ class Engine(_EngineBase):
|
|
|
246
246
|
config. Default values can be configured via `config.edit()`, see
|
|
247
247
|
`Configuration <https://csoundengine.readthedocs.io/en/latest/config.html>`_
|
|
248
248
|
|
|
249
|
+
.. note::
|
|
250
|
+
|
|
251
|
+
These env variables can customize the engine:
|
|
252
|
+
|
|
253
|
+
* LIBCSOUNDPATH: points to a valid libcsound dll. This can only be called once
|
|
254
|
+
within a session
|
|
255
|
+
* CSOUND7DIR64 / CSOUND6DIR64: path to the folder containing built-in plugins
|
|
256
|
+
* CS_USER_PLUGINDIR: path to the folder where user (external) plugins are placed
|
|
257
|
+
|
|
258
|
+
|
|
249
259
|
Example
|
|
250
260
|
-------
|
|
251
261
|
|
|
@@ -315,7 +325,8 @@ class Engine(_EngineBase):
|
|
|
315
325
|
busSupport=False,
|
|
316
326
|
nosound=False,
|
|
317
327
|
useProcessQueue=False,
|
|
318
|
-
suppressVersion=True
|
|
328
|
+
suppressVersion=True,
|
|
329
|
+
opcodeDir=''
|
|
319
330
|
):
|
|
320
331
|
import libcsound as lcs
|
|
321
332
|
from . import csoundlib
|
|
@@ -549,7 +560,7 @@ class Engine(_EngineBase):
|
|
|
549
560
|
self.udpPort = 0
|
|
550
561
|
"UDP port used (0 if no udp port is active)"
|
|
551
562
|
|
|
552
|
-
self.csound: lcs.Csound = lcs.Csound()
|
|
563
|
+
self.csound: lcs.Csound = lcs.Csound(opcodeDir=opcodeDir)
|
|
553
564
|
"The csound object"
|
|
554
565
|
|
|
555
566
|
self.autosync: bool = autosync
|
|
@@ -62,13 +62,12 @@ class TableInfo:
|
|
|
62
62
|
|
|
63
63
|
|
|
64
64
|
def _channelMode(kind: str) -> int:
|
|
65
|
-
import libcsound
|
|
66
65
|
if kind == 'r':
|
|
67
|
-
return
|
|
66
|
+
return 16
|
|
68
67
|
elif kind == 'w':
|
|
69
|
-
return
|
|
68
|
+
return 32
|
|
70
69
|
elif kind == 'rw':
|
|
71
|
-
return
|
|
70
|
+
return 16 | 32
|
|
72
71
|
else:
|
|
73
72
|
raise ValueError(f"Expected r, w or rw, got {kind}")
|
|
74
73
|
|
|
@@ -371,7 +371,7 @@ class Instr:
|
|
|
371
371
|
self.pfieldIndexToValue: Mapping[int, float | str] = pargsIndexToValue
|
|
372
372
|
"Dict mapping pfield index to its default value"
|
|
373
373
|
|
|
374
|
-
self.aliases = aliases if aliases is not None else EMPTYDICT
|
|
374
|
+
self.aliases: dict[str, str] = aliases if aliases is not None else EMPTYDICT
|
|
375
375
|
"""Maps alias argument names to their real argument names
|
|
376
376
|
|
|
377
377
|
Aliased parameters can be pfields or named controls"""
|
|
@@ -610,7 +610,6 @@ class Instr:
|
|
|
610
610
|
|
|
611
611
|
Args:
|
|
612
612
|
aliases: include aliases
|
|
613
|
-
aliased: include parameters which have an alias (implies aliases)
|
|
614
613
|
|
|
615
614
|
Returns:
|
|
616
615
|
a set of the dynamic (modifiable) parameters accepted by this Instr
|
|
@@ -628,7 +627,6 @@ class Instr:
|
|
|
628
627
|
|
|
629
628
|
Args:
|
|
630
629
|
aliases: include aliases
|
|
631
|
-
aliased: include parameters which have an alias (implies aliases)
|
|
632
630
|
|
|
633
631
|
Returns:
|
|
634
632
|
a dict mapping pfield name to default value.
|
|
@@ -724,7 +722,7 @@ class Instr:
|
|
|
724
722
|
|
|
725
723
|
Args:
|
|
726
724
|
aliases: include aliases
|
|
727
|
-
|
|
725
|
+
|
|
728
726
|
Returns:
|
|
729
727
|
a set with the named pfields defined in this instr
|
|
730
728
|
"""
|
|
@@ -741,7 +739,7 @@ class Instr:
|
|
|
741
739
|
|
|
742
740
|
def paramValue(self, param: str) -> float | str | None:
|
|
743
741
|
param2 = self.unaliasParam(param, param)
|
|
744
|
-
defaults = self.paramDefaultValues(
|
|
742
|
+
defaults = self.paramDefaultValues()
|
|
745
743
|
if param2 not in defaults:
|
|
746
744
|
raise KeyError(f"Unknown parameter '{param}'. "
|
|
747
745
|
f"Possible parameters: {defaults.keys()}")
|
|
@@ -758,7 +756,6 @@ class Instr:
|
|
|
758
756
|
|
|
759
757
|
Args:
|
|
760
758
|
aliases: included aliases
|
|
761
|
-
aliased: include parameters which have an alias
|
|
762
759
|
|
|
763
760
|
Returns:
|
|
764
761
|
a dict of named dynamic parameters to this instr and their associated
|
|
@@ -176,6 +176,15 @@ class OfflineEngine(_EngineBase):
|
|
|
176
176
|
If no encoding is given a suitable default for the sample format is chosen.
|
|
177
177
|
|
|
178
178
|
|
|
179
|
+
.. note::
|
|
180
|
+
|
|
181
|
+
These env variables can customize the engine:
|
|
182
|
+
|
|
183
|
+
* LIBCSOUNDPATH: points to a valid libcsound dll. This can only be called once
|
|
184
|
+
within a session
|
|
185
|
+
* CSOUND7DIR64 / CSOUND6DIR64: path to the folder containing built-in plugins
|
|
186
|
+
* CS_USER_PLUGINDIR: path to the folder where user (external) plugins are placed
|
|
187
|
+
|
|
179
188
|
"""
|
|
180
189
|
def __init__(self,
|
|
181
190
|
sr=44100,
|
|
@@ -192,7 +201,8 @@ class OfflineEngine(_EngineBase):
|
|
|
192
201
|
sampleAccurate=False,
|
|
193
202
|
encoding='',
|
|
194
203
|
nosound=False,
|
|
195
|
-
commandlineOptions: list[str] | None = None
|
|
204
|
+
commandlineOptions: list[str] | None = None,
|
|
205
|
+
opcodeDir=''):
|
|
196
206
|
super().__init__(sr=sr,
|
|
197
207
|
ksmps=ksmps,
|
|
198
208
|
a4=a4 or config['A4'],
|
|
@@ -250,6 +260,8 @@ class OfflineEngine(_EngineBase):
|
|
|
250
260
|
if commandlineOptions:
|
|
251
261
|
self.options.extend(commandlineOptions)
|
|
252
262
|
|
|
263
|
+
self._opcodeDir = opcodeDir
|
|
264
|
+
|
|
253
265
|
self.csound: libcsound.Csound
|
|
254
266
|
|
|
255
267
|
self._start()
|
|
@@ -277,7 +289,7 @@ class OfflineEngine(_EngineBase):
|
|
|
277
289
|
def _start(self) -> None:
|
|
278
290
|
import libcsound
|
|
279
291
|
self.version = libcsound.VERSION
|
|
280
|
-
self.csound = csound = libcsound.Csound()
|
|
292
|
+
self.csound = csound = libcsound.Csound(opcodeDir=self._opcodeDir)
|
|
281
293
|
for option in self.options:
|
|
282
294
|
csound.setOption(option)
|
|
283
295
|
if not self.nosound:
|
|
@@ -353,15 +353,16 @@ class SchedEventGroup(BaseSchedEvent):
|
|
|
353
353
|
def _setTable(self, param: str, value: float, delay=0.) -> None:
|
|
354
354
|
count = 0
|
|
355
355
|
for ev in self:
|
|
356
|
-
if param in ev.controlNames(aliases=True
|
|
356
|
+
if param in ev.controlNames(aliases=True):
|
|
357
357
|
ev._setTable(param=param, value=value, delay=delay)
|
|
358
358
|
count += 1
|
|
359
359
|
if count == 0:
|
|
360
360
|
raise KeyError(f"Parameter '{param}' unknown. "
|
|
361
|
-
f"Possible parameters: {self.dynamicParamNames(
|
|
361
|
+
f"Possible parameters: {self.dynamicParamNames()}, "
|
|
362
|
+
f"aliases: {self.aliases()}")
|
|
362
363
|
|
|
363
364
|
@cache
|
|
364
|
-
def paramNames(self, aliases=True
|
|
365
|
+
def paramNames(self, aliases=True) -> frozenset[str]:
|
|
365
366
|
allparams = set()
|
|
366
367
|
for ev in self:
|
|
367
368
|
allparams.update(ev.paramNames(aliases=aliases))
|
|
@@ -394,13 +395,13 @@ class SchedEventGroup(BaseSchedEvent):
|
|
|
394
395
|
return hash(tuple(hash(ev) for ev in self))
|
|
395
396
|
|
|
396
397
|
@cache
|
|
397
|
-
def controlNames(self, aliases=True
|
|
398
|
+
def controlNames(self, aliases=True) -> frozenset[str]:
|
|
398
399
|
"""
|
|
399
400
|
Returns a set of available table named parameters for this group
|
|
400
401
|
"""
|
|
401
402
|
allparams = set()
|
|
402
403
|
for event in self:
|
|
403
|
-
params = event.controlNames(aliases=aliases
|
|
404
|
+
params = event.controlNames(aliases=aliases)
|
|
404
405
|
if params:
|
|
405
406
|
allparams.update(params)
|
|
406
407
|
return frozenset(allparams)
|
|
@@ -444,5 +445,5 @@ class SchedEventGroup(BaseSchedEvent):
|
|
|
444
445
|
delay=delay, overtake=overtake)
|
|
445
446
|
if count == 0:
|
|
446
447
|
raise KeyError(f"Param '{param}' not known by any events in this group. "
|
|
447
|
-
f"Possible parameters: {self.dynamicParamNames(
|
|
448
|
+
f"Possible parameters: {self.dynamicParamNames()}, aliases: {self.aliases()}")
|
|
448
449
|
return 0.
|
|
@@ -975,12 +975,13 @@ class SynthGroup(BaseSchedEvent):
|
|
|
975
975
|
return None
|
|
976
976
|
|
|
977
977
|
def _setPfield(self, param: str, value: float, delay=0.) -> None:
|
|
978
|
-
|
|
978
|
+
found = False
|
|
979
979
|
for synth in self.synths:
|
|
980
|
-
if synth.instr.pfieldIndex(param) is not None
|
|
981
|
-
synth.
|
|
982
|
-
|
|
983
|
-
|
|
980
|
+
if synth.instr.pfieldIndex(param) is not None:
|
|
981
|
+
if synth.playStatus() != 'stopped':
|
|
982
|
+
synth._setPfield(param=param, value=value, delay=delay)
|
|
983
|
+
found = True
|
|
984
|
+
if not found:
|
|
984
985
|
raise KeyError(f"Parameter {param} unknown. "
|
|
985
986
|
f"Possible parameters: {self.dynamicParamNames()}")
|
|
986
987
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: csoundengine
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.23.0
|
|
4
4
|
Summary: An audio synthesis framework using csound
|
|
5
5
|
Author-email: Eduardo Moguillansky <eduardo.moguillansky@gmail.com>
|
|
6
6
|
License: GNU GENERAL PUBLIC LICENSE
|
|
@@ -695,7 +695,7 @@ Requires-Dist: ipywidgets
|
|
|
695
695
|
Requires-Dist: xxhash
|
|
696
696
|
Requires-Dist: docstring_parser
|
|
697
697
|
Requires-Dist: typing_extensions
|
|
698
|
-
Requires-Dist: libcsound>=0.
|
|
698
|
+
Requires-Dist: libcsound>=0.16.1
|
|
699
699
|
Requires-Dist: sndfileio>=2.1.1
|
|
700
700
|
Requires-Dist: emlib>=1.20
|
|
701
701
|
Requires-Dist: configdict>=2.10.0
|
|
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
|
|
|
5
5
|
|
|
6
6
|
[project]
|
|
7
7
|
name = "csoundengine"
|
|
8
|
-
version = "2.
|
|
8
|
+
version = "2.23.0"
|
|
9
9
|
license = { file = "LICENSE.txt" }
|
|
10
10
|
description = "An audio synthesis framework using csound"
|
|
11
11
|
authors = [
|
|
@@ -35,7 +35,7 @@ dependencies = [
|
|
|
35
35
|
"docstring_parser",
|
|
36
36
|
"typing_extensions",
|
|
37
37
|
|
|
38
|
-
"libcsound>=0.
|
|
38
|
+
"libcsound>=0.16.1",
|
|
39
39
|
"sndfileio>=2.1.1",
|
|
40
40
|
"emlib>=1.20",
|
|
41
41
|
"configdict>=2.10.0",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|