Login
Synthesizer
Login

Classes and Structures

Class: SYNTHESIZER (AUDIO-RENDERER)

A SoundFont synthesizer. This class is not actually exported from the CL-MELTYSYNTH package since it is intended to be opaque. Instances of this class should always be created using the generic function MAKE-SYNTHESIZER.

Note that this class does not provide thread safety. If you wish to send notes and render the waveform in separate threads, you must ensure that the related methods/functions will not be called simultaneously.

Available slot readers (these must be set using the SYNTHESIZER-SETTINGS class):

  • SYNTH-MAXIMUM-POLYPHONY synthesizer -> t/max-polyphony
  • SYNTH-EFFECTS synthesizer -> t/effect-list
  • SYNTH-INTERPOLATION-MODE synthesizer -> t/interpolation-mode
  • SYNTH-REVERB-TYPE synthesizer -> t/reverb-type
  • SYNTH-REVERB-UNIT synthesizer -> (or null schroeder-reverb zita-reverb)
  • SYNTH-REVERB-SEND synthesizer -> t/channel-effect-send
  • SYNTH-CHORUS-SEND synthesizer -> t/channel-effect-send
  • SYNTH-INST-REVERB-OVERRIDE synthesizer -> (or null t/instrument-override
  • SYNTH-INST-CHORUS-OVERRIDE synthesizer -> (or null t/instrument-override

Available slot accessors are: * SYNTH-MAIN-VOLUME synthesizer -> t/main-volume * (SETF SYNTH-MAIN-VOLUME) t/main-volume synthesizer

Class: SYNTHESIZER-SETTINGS

This class is used to set various parameters of the SYNTHESIZER class. Instances of this class should always be created using the MAKE-SYNTHESIZER-SETTINGS function.

Available slot accessors (all SETF-able) are:

  • SYNTH-SETTING-SAMPLE-RATE synthesizer-settings -> t/sample-rate
  • SYNTH-SETTING-MAX-POLYPHONY synthesizer-settings -> t/max-polyphony
  • SYNTH-SETTING-EFFECTS synthesizer-settings -> t/effect-list
  • SYNTH-SETTING-REVERB-SEND synthesizer-settings -> t/channel-effect-send
  • SYNTH-SETTING-CHORUS-SEND synthesizer-settings -> t/channel-effect-send
  • SYNTH-SETTING-INST-REVERB-OVERRIDE synthesizer-settings -> t/instrument-override
  • SYNTH-SETTING-INST-CHORUS-OVERRIDE synthesizer-settings -> t/instrument-override
  • SYNTH-SETTING-ENABLE-PRESET-REMAPPING-P synthesizer-settings -> boolean
  • SYNTH-SETTING-INTERPOLATION-MODE synthesizer-settings -> t/interpolation-mode
  • SYNTH-SETTING-REVERB-TYPE synthesizer-settings -> t/reverb-type
  • SYNTH-SETTING-MAIN-VOLUME synthesizer-settings -> t/main-volume

Function: MAKE-SYNTHESIZER-SETTINGS &key lots of keywords -> synthesizer-settings

Used to construct a SYNTHESIZER-SETTINGS instance. All slots can be set using this function, which will be checked for valid values.

Generic Function: MAKE-SYNTHESIZER [soundfont] [settings] -> synthesizer

Creates a new SYNTHESIZER instance and initializes it with the given settings.

SOUNDFONT can be either a STRING, PATHNAME, or a SOUNDFONT instance.

SETTINGS can be one of the following:

  • An integer specifying the sample rate
  • A SYNTHESIZER-SETTINGS instance containing settings for the new synthesizer

Function: SYNTH-PROCESS-MIDI-MESSAGE synthesizer (unsigned-byte 8) (unsigned-byte 8) (unsigned-byte 8) (unsigned-byte 8)

Processes a MIDI message with the given synthesizer.

Function SYNTH-NOTE-OFF synthesizer (unsigned-byte 8) fixnum

Stops a note on the given channel.

Function SYNTH-NOTE-ON synthesizer (unsigned-byte 8) (unsigned-byte 8) (unsigned-byte 8)

Starts playing a note on the given channel with the given velocity.

Function SYNTH-NOTE-OFF-ALL synthesizer [immediate?] &optional [channel]

Stops all notes that are currently playing. If IMMEDIATE? is truthy, then notes will stop immediately without processing their release envelopes. A specific channel (an (UNSIGNED-BYTE 8)) can optionally be specified, otherwise this operates on all channels.

Function SYNTH-RESET-ALL-CONTROLLERS synthesizer &optional [channel]

Resets all of the controllers. If a channel is specified (an (UNSIGNED-BYTE 8)), then the controllers are only reset on that channel, otherwise they are reset on all of them.

Function SYNTH-RESET synthesizer

Resets the synthesizer. This resets all voices, all channels, and (when enabled) mutes the chorus and reverb. This also resets the default channel reverb/chorus values to the value returned by SYNTH-REVERB-SEND and SYNTH-CHORUS-SEND.