Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
gesellkammer committed Jan 16, 2025
1 parent 4e5a208 commit 85396c4
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 7 deletions.
5 changes: 3 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@
html_theme_options = {
"show_navbar_depth": 3,
"max_navbar_depth": 5,
"show_toc_level": 2
"show_toc_level": 2,
"use_fullscreen_button": False,

}


# Disable having a separate return type row
napoleon_use_rtype = False

Expand Down
49 changes: 49 additions & 0 deletions libcsound/api6.py
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,55 @@ def setOption(self, option: str) -> int:
Multiple options are allowed in one string.
Returns zero on success.
.. rubric:: Options
``--output= (-o)``
Output device or filename. ``-odac`` for realtime
audio using the default device. When using jack,
``-odac:<portpattern>``, for example
``-odac:"Built-in Audio Analog Stereo"`` will connect
to all ports matching the given pattern
``--input= (-i)``
Input device or filename. Similar to ``-o``
``-+rtaudio=<module>``
Real-time audio module, used with ``-odac...``, possible
values are ``portaudio``, ``auhal`` (coreaudio, only in macos),
``alsa`` (linux only), ``jack``, ``pulse`` (pulseaudio, linux)
``-+rtmidi=``
Real time MIDI module
``--nodisplays (-d)``
Supress all displays
``--format=<fmt>``
Soundfile format, one of ``wav, aiff, w64, flac, caf, ogg, mpeg``
``--format=<fmt>``
Sample format, one of ``alaw, ulaw, float, double, short, long, 24bit, vorbis``
``--midi-device=<dev>``
Read MIDI from the given device
``--realtime``
Realtime priority mode
``--sample-accurate``
Use sample-accurate timing of score events
``--nosound``
No sound onto disk or device
``--messagelevel=N (-m)``
Console message level, sum of: 1=note amps, 2=out-of-range msg,
4=warnings, 0/32/64/96=note amp format (raw,dB,colors),
128=print benchmark information. Use ``-m0`` to disable note messages
``--use-system-sr``
Use the system samplerate for realtime audio. Not all audio backends
define a system sr. Backends which do define system sr: ``jack``,
``auhal``, ``pulse``
``--get-system-sr``
Print system sr and exit, requires realtime audio output
(e.g. -odac) to be defined first)
``--port=N``
Listen to UDP port N for orchestra code (implies ``--daemon``)
``--limiter[=num]``
Include clipping in audio output
See ``csound --help`` for a complete list of options
"""
parts = _util.splitCommandLine(option)
out = 0
Expand Down
68 changes: 63 additions & 5 deletions libcsound/api7.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,55 @@ def setOption(self, option: str) -> int:
**Options can only be set before the csound process is started**. Multiple
options are allowed in one string.
.. rubric:: Options
``--output= (-o)``
Output device or filename. ``-odac`` for realtime
audio using the default device. When using jack,
``-odac:<portpattern>``, for example
``-odac:"Built-in Audio Analog Stereo"`` will connect
to all ports matching the given pattern
``--input= (-i)``
Input device or filename. Similar to ``-o``
``-+rtaudio=<module>``
Real-time audio module, used with ``-odac...``, possible
values are ``portaudio``, ``auhal`` (coreaudio, only in macos),
``alsa`` (linux only), ``jack``, ``pulse`` (pulseaudio, linux)
``-+rtmidi=``
Real time MIDI module
``--nodisplays (-d)``
Supress all displays
``--format=<fmt>``
Soundfile format, one of ``wav, aiff, w64, flac, caf, ogg, mpeg``
``--format=<fmt>``
Sample format, one of ``alaw, ulaw, float, double, short, long, 24bit, vorbis``
``--midi-device=<dev>``
Read MIDI from the given device
``--realtime``
Realtime priority mode
``--sample-accurate``
Use sample-accurate timing of score events
``--nosound``
No sound onto disk or device
``--messagelevel=N (-m)``
Console message level, sum of: 1=note amps, 2=out-of-range msg,
4=warnings, 0/32/64/96=note amp format (raw,dB,colors),
128=print benchmark information. Use ``-m0`` to disable note messages
``--use-system-sr``
Use the system samplerate for realtime audio. Not all audio backends
define a system sr. Backends which do define system sr: ``jack``,
``auhal``, ``pulse``
``--get-system-sr``
Print system sr and exit, requires realtime audio output
(e.g. -odac) to be defined first)
``--port=N``
Listen to UDP port N for orchestra code (implies ``--daemon``)
``--limiter[=num]``
Include clipping in audio output
See ``csound --help`` for a complete list of options
"""
if self._compilationStarted:
raise RuntimeError(f"Cannot set options once code has already been compiled")
Expand Down Expand Up @@ -756,11 +805,11 @@ def modules(self) -> list[tuple[str, str]]:
Returns a list of modules
Returns:
a list of tuples of the form (name: str, type: str),
a list of tuples of the form ``(name: str, type: str)``,
where name is the name of the module and type is one of
"audio" or "midi"
.. seealso:: :meth:`Csound.module`
.. seealso:: :py:meth:`module`
"""
n = 0
out = []
Expand Down Expand Up @@ -897,6 +946,7 @@ def compileOrc(self, orc: str, block=True) -> int:
cs.scoreEvent(...)
cs.perform()
.. seealso:: :meth:`PerformanceThread.compileOrc`
"""
return libcsound.csoundCompileOrc(self.cs, cstring(orc), ct.c_int32(not block))

Expand All @@ -917,6 +967,9 @@ def compileOrcAsync(self, orc: str) -> int:
The code is parsed and compiled, then placed on a queue for
asynchronous merge into the running engine, and evaluation.
The function returns following parsing and compilation.
.. seealso:: :meth:`PerformanceThread.compileOrc`
"""
return self.compileOrc(orc, block=False)

Expand Down Expand Up @@ -2657,9 +2710,14 @@ def UDPServerStart(self, port: int) -> int:
.. note::
Not present in csound 7. This is placed here for compatibility
with csound 6. In csound 7 this functionality is not exposed through
the API and must be set via command-line options (``--port=...``),
see :meth:`~Csound.setOption`
with csound 6.
In csound 7 this functionality is not exposed through the API and must
be set via command-line options (``--port=...``). This means that the
UDP server can only be started before any compilation has taken place,
since options can not be set after the csound process has been started
.. seealso:: :py:meth:`setOption`
"""
self.setOption(f'--port={port}')
return CSOUND_SUCCESS
Expand Down

0 comments on commit 85396c4

Please sign in to comment.