Zyn

Code for calling the ZynAddSubFX synth.

Zyn does not have a Python API but it can:

  1. Save its whole state to a master xml file

  2. Load instruments from xml files

This module implements reading and writing Zyn xml files. It allows jird to automatically retune and configure Zyn by loading Zyn instruments and building a Zyn master xml.

It turns out that while the master xml file does contain blocks corresponding to the xml in the loaded instrument xml, Zyn does quite a bit of processing of the instrument xml before it is added to the master. Most of this is implemented here (some of the version-specific adjustments are not yet implemented).

play_with_zyn(config, part_channels, scala_data, filepath)[source]

Play music with Zyn.

Generate a Zyn master config from Zyn instruments and any scala tuning data. Run Zyn with this config. Send midi to Zyn with aplaymidi. Kill Zyn when done.

Parameters:
  • config (Config) – Config controlling playback.

  • part_channels (list of list of int) – Midi channels used for each part.

  • scala_data (ScalaData, optional) – Scala tuning files and frequency map.

  • filepath (Path) – Path to midi file.

class ZynConfig(master, information=<factory>, base_parameters=<factory>)[source]

Top level Zyn config.