Surge

Code to interact with the Surge XT synth.

Uses surgepy, the Surge XT Python API. This can be installed by cloning the surge repo and pip installing, e.g.

$ git clone https://github.com/surge-synthesizer/surge.git
$ python3 -m pip install surge/src/surge-python

There is an example surgepy Jupyter notebook here.

play_with_surge(music, config, filepath)[source]

Play music with Surge XT.

Use surgepy to render music to an array. Write array to wav file. Play wav file with aplay.

Parameters:
  • music (Piece) – Music to play.

  • config (Config) – Config specifying details of playback.

  • filepath (Path) – Path used as base of output wav-file name.

setup_surge(sample_rate)[source]

Set up SurgeSynthesizer instance.

At most one SurgeSynthesizer is set up in a given Python process.

Parameters:

sample_rate (int) – Sample rate to use in the synth.

Raises:

ModuleNotFoundError – If surgepy could not be imported.