Karya, built on 2020-11-26T21:03:17 (patch 23b5be2d53a9e8e7d6136cda5aae2849abe5cded)
Safe HaskellNone




Im-specific controls. Generally they are per-instrument, but like Derive.Controls, it's useful to have a standard vocabulary.



newtype Control Source #

Unlike Control, pitch is just another control.


Control Text 


Instances details
Eq Control # 
Instance details

Defined in Synth.Shared.Control


(==) :: Control -> Control -> Bool #

(/=) :: Control -> Control -> Bool #

Ord Control # 
Instance details

Defined in Synth.Shared.Control

Show Control # 
Instance details

Defined in Synth.Shared.Control

String.IsString Control # 
Instance details

Defined in Synth.Shared.Control

Pretty Control # 
Instance details

Defined in Synth.Shared.Control

Serialize.Serialize Control # 
Instance details

Defined in Synth.Shared.Control

dynamic :: Control Source #

This should come from dynamic. Unlike score-level dyn, whose meaning is abstract, this should be more or less on a dB scale, where 0 corresponds to minimumDb.

It can be more closely defined here because im instruments have direct control over the sound they produce, while other backends, like MIDI, are up to the whims of the synthesizer's interpretation.

volume :: Control Source #

This is similar to dynamic, but this always maps to physical volume, for the case where an instrument distinguishes between dynamic level and volume level. The score-level equivalent is vol which corresponds to MIDI cc7 in the MIDI backend.

minimumDb :: Double Source #

A dynamic of 1 maps to 0dB of attenuation, and 0 maps to this level. Humans maybe have a limit around 120dB, but 96 is a theoretical maximum for 16 bit audio, which is likely what this turns into anyway.

My manual experiment shows that -96 on a normalized sample is just about inaudible.

dbToVolume :: Double -> Double Source #

Get volume value for the given dB.

pan :: Control Source #

  • 1 means pan left, 1 means pan right. Unlike other controls, the range is
  • 1 to 1 instead of 0 to 1. This is so adding signals is the same as adding pan, and a 0 signal has no effect.

pitch :: Control Source #

Pitch in NoteNumbers.

gate :: Control Source #

Used by some synths to mark note start and end times. This should be used internally, not exposed.

variation :: Control Source #

An integral variation, for "random" variant samples.

mute :: Control Source #

Amount of mutedness, for instruments that support variable amount of mute.

sampleTimeStretch :: Control Source #

Inflict time stretch on the sample.

samplePitchShift :: Control Source #

Inflict pitch shift on the sample. Units are Pitch.NoteNumbers.