Skip to main content

Python tools used to interact with (appropriately compiled) Chaos Stratus effect libraries

Project description

chaos-stratus

This package provides tools for interacting with (appropriately compiled) Chaos Audio Stratus pedal effects libraries.

By "appropriately compiled" we mean built with the Stratus build tools available with the most recent versions of Faust, or with the Faust IDE.

(Note that prior to the full Faust integration of the Stratus development tools, effects libraries were built in such a way as to NOT be fully compatible with these tools).

Installation

You can install this package using a standard pip invocation

python -m pip install chaos-stratus

Usage/Examples

The main class of these tools is Effect.

You include that into your python script in the standard manner:

from chaos_stratus import Effect

You instantiate the class for a specific effect library as follows:

effect = Effect("path/to/my/effect.so")

See the module documentation for the API available to you.

Examples

Reporting on information concerning the library

import sys
from chaos_stratus import Effect

lib = sys.argv[1]
effect = Effect(lib)
print(f'Stratus effect library {lib}:')
print(f'  Effect name:....... {effect.name}')
print(f'  Effect ID:......... {effect.effectId}')
print(f'  Effect version:.... {effect.version}')
print(f'  Number of knobs:... {effect.knobCount}')
print(f'  Number of switches: {effect.switchCount}')

This is, in fact, what is implemented by the command:

python -m chaos_stratus "path/to/my/effect.so"

Applying the effect on raw sample data

Possibly the most interesting thing you can do with the tools is to apply the effect to test sample data, with different knob and switch values, and check that the output is what you expected.

This is how you can do that with raw sample from stdin, sending output to stdout:

import sys
from chaos_stratus import Effect

lib = sys.argv[1]
effect = Effect(lib)

#
# Set knobs/switches to desired values
#
effect.setKnob(1, 0.5)

#
# Run the effect on stdin
#
BUFFERSIZE=8192
DATA_IN=sys.stdin.buffer
DATA_OUT=sys.stdout.buffer
input_buffer=bytearray(BUFFERSIZE)
while True:
    insize = DATA_IN.readinto(input_buffer)
    if insize == 0:
        break
    DATA_OUT.write(effect.computeBuf(input_buffer[:insize]))

To use that with, say, a wav input file and pump the output to the default output device of your computer (say, your headphones)

  • install sox
  • write a Python script based on the above sample code
  • Find a suitable wav file (or any other format that Sox supports out of the box)
  • Run it all like this from the (shell) command line:
sox your-sounds.wav -b32 -e floating-point -r 44100 -t raw - | \
    python my-effect-script.py path/to/my/effect.so | \
    sox -b32 -e floating-point -r 44100 -t raw - -d

Add more effects to your pipeline at will :).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chaos_stratus-1.0.1.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chaos_stratus-1.0.1-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file chaos_stratus-1.0.1.tar.gz.

File metadata

  • Download URL: chaos_stratus-1.0.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.12

File hashes

Hashes for chaos_stratus-1.0.1.tar.gz
Algorithm Hash digest
SHA256 77776c0fd784ed9d5fe5a8fc4101c21226aeabbe6056c6469dfdf560eec82632
MD5 faad2c4c832aef2f705a1f6e4b615b29
BLAKE2b-256 0a9f6b3f06f560edb6cce05e6b8e88ac38f53f5ea542a6522d4e064c5b46f777

See more details on using hashes here.

File details

Details for the file chaos_stratus-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: chaos_stratus-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.10.12

File hashes

Hashes for chaos_stratus-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 43673eb72686978149e64f1ab128dd16aa27e87767589e4f9ee8b0d369e64839
MD5 607ca8f16a42d710fd4c89590d763e22
BLAKE2b-256 9c7b7f482b1d8b60ba74b4071cac1771a3bef30f7c598f89aaef297a64c60e76

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page