Karya, built on 2022-03-21T01:30:44 (patch 89d1651424c35e564138d93424a157ff87457245)
Safe HaskellSafe-Inferred

Synth.Shared.Control

Contents

Description

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

Synopsis

Documentation

newtype Control Source #

Unlike Control, pitch is just another control.

Constructors

Control Text 

Instances

Instances details
String.IsString Control Source # 
Instance details

Defined in Synth.Shared.Control

Show Control Source # 
Instance details

Defined in Synth.Shared.Control

Eq Control Source # 
Instance details

Defined in Synth.Shared.Control

Methods

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

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

Ord Control Source # 
Instance details

Defined in Synth.Shared.Control

Pretty Control Source # 
Instance details

Defined in Synth.Shared.Control

Serialize.Serialize Control Source # 
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.

Supported