csoundlib - Utilities to work with csound#
csoundengine.csoundlib Module#
This module provides miscellaneous functionality for working with csound.
This functionality includes:
parse csound code
generate a
.csd
fileinspect the audio environment
query different paths used by csound
etc.
Functions#
|
Return a list of audio backends for the given platform |
Given an extension, return the best sample encoding. |
|
|
Channel type (k, S, a) from value |
|
Convert a bitrate to a compression quality between 0-1, as passed to --vbr-quality |
|
Convert compression quality to bitrate |
|
Returns the command-line option for the given sample encoding. |
|
Returns the command-line options for the given format+encoding |
|
Calls csound with given args in a subprocess, returns a subprocess.Popen object. |
Prints all available backends and their properties as a table |
|
|
Print a list of audio devices for the given backend. |
|
Dump information about audio backends and audio devices for the selected backend |
|
Read a file saved by ftsave, returns a list of tables |
|
Given the name of the backend, return the AudioBackend structure |
|
Returns a list with the names of the audio backends for a given platform |
|
Returns (indevices, outdevices), where each of these lists is an AudioDevice. |
|
Returns the default audio devices for a given backend |
Get the default active backend for platform |
|
|
Get the default number of channels for a given device |
|
Returns the samplerate reported by the given backend |
|
Get the system samplerate for a given backend |
|
Returns the csound version as tuple (major, minor, patch) |
|
Converts csound code to html with syntax highlighting |
|
Returns the list of names/instrument numbers in the instrument definition. |
|
Parses the body of an instrument, returns pfields used, output channels, etc. |
|
Is name a pfield? |
|
Joins an orc and a score (both as str), returns a csd as string |
|
Line of the last assignment to a variable |
|
Locate the docstring in this instr code |
|
Given a path, creates the #include directive |
|
Returns input and output midi devices for the given backend |
|
Stretch/Pitchshift a output using csound's mincer opcode (offline) |
|
Returns the power of 2 higher or equal than n |
|
Transform name so that it can be accepted as an instrument name |
|
Return the platform as given by sys.platform |
|
Return a list of the opcodes present |
|
Parse orchestra code into blocks |
|
Parse a score given as string, returns a data. |
|
Record one instrument for a given duration |
|
Run the given .csd as a csound subprocess |
|
Saves the data to a gen23 table |
|
Save a numpy 2D array as gen23 |
|
Save data in wav format using the mtx extension |
|
Make a SoundFontIndex for the given soundfont |
|
Get the instrument number from a preset |
|
Get instruments for a soundfont |
|
Get presets from a soundfont |
|
Select a preset from a soundfont interactively |
|
|
|
Given an include line it splits the include path |
|
Test the current csound installation for realtime output |
|
Returns the user plugins folder for this platform |
Classes#
|
Special type indicating an unconstrained type. |
|
Holds information about a csound audio backend |
|
An AudioDevice holds information about a an audio device for a given backend |
|
Build a csound script by adding global code, instruments, score events, etc. |
|
A CsoundProc wraps a running csound subprocess |
|
A MidiDevice holds information about a midi device for a given backend |
|
A ParsedBlock represents a block (an instr, an opcode, etc) in an orchestra |
|
The result of parsing the body of an instrument |
|
An event line in the score (an instrument, a table declaration, etc.) |
|
Creates an index of presets for a given soundfont |
|
A table holding either the data or a file to the data |
|
To be used as decorator. |