Login
Types and Enums
Login

A Quick Note About Enums

Common Lisp does not have native enum types. CL-MeltySynth gets around this by using CL-SDM's "pseudo-enum" types, where keyword symbols are automatically mapped to an integer or string. With these, each pseudo-enum type defines a set of functions:

  • <type>->MEMBERS: The defined members for this enum, that is, the valid keyword symbols for this type. For example, T/INTERPOLATION-MODE-MEMBERS. You can use this to get the members of the enum type.
  • <type>->VALUES: The defined values for this enum. For example, T/INTERPOLATION-MODE-VALUES.
  • VALID-<type>-P: Returns T if something is of that enumeration type, or NIL otherwise.
  • <type>->STR and <type>->INT: Converts a keyword symbol to its corresponding value.
  • <type>->STR? and <type>->INT?: Converts a keyword symbol to its corresponding value, or NIL if that symbol is not valid for that enum.
  • STR-><type> and INT-><type>: Converts a value to its corresponding keyword symbol.
  • <type>->STR? and <type>->INT?: Converts a value to its corresponding keyword, or NIL if that value is not valid for that enum.

Types

T/REVERB-TYPE

The valid reverb types. This is an alias for (MEMBER :SCHROEDER :FREEVERB :REMIVERB :ZITA :PLATE-1 :PLATE-2 :PLATE-3 :HALL-1).

T/INTERPOLATION-MODE

An enum that defines the valid interpolation modes in CL-MeltySynth.

T/MIDI-FILE-LOOP-TYPE

An enum that defines the supported loop types for MIDI files.

T/EFFECT

A valid effect type. This is an alias for (MEMBER :REVERB :CHORUS).

T/EFFECT-LIST

A list that contains only T/EFFECT elements.

T/CHANNEL-EFFECT-SEND

The valid range for effect send levels. This is an alias for (INTEGER 0 255).

T/INSTRUMENT-OVERRIDE

The valid range for instrument/preset reverb and chorus override levels. This is an alias for (INTEGER 0 1000).

T/MAX-POLYPHONY

The valid range for maximum polyphony values. This is an alias for (INTEGER 8 255).

T/MAIN-VOLUME

The valid range for the main volume of the synthesizer. This is an alias for (DOUBLE-FLOAT 0.0 1.0).

T/SAMPLE-RATE

The supported range of sample rates. This is an alias for (INTEGER 11025 192000).