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

Cmd.Instrument.MidiInst

Description

Utilities for the instrument definitions in Local.Instrument.

Synopsis

Documentation

code

data Code Source #

A version of Cmd.InstrumentCode that's more convenient for record update syntax.

Instances

Instances details
Monoid Code Source # 
Instance details

Defined in Cmd.Instrument.MidiInst

Methods

mempty :: Code #

mappend :: Code -> Code -> Code #

mconcat :: [Code] -> Code #

Semigroup Code Source # 
Instance details

Defined in Cmd.Instrument.MidiInst

Methods

(<>) :: Code -> Code -> Code #

sconcat :: NonEmpty Code -> Code #

stimes :: Integral b => b -> Code -> Code #

Pretty.Pretty Code Source # 
Instance details

Defined in Cmd.Instrument.MidiInst

data Call d Source #

Bundle together generators and transformers. The rationale is described in CallMaps.

note_generators :: [(Expr.Symbol, Generator Note)] -> Code Source #

Add the given calls to the note track scope.

note_transformers :: [(Expr.Symbol, Transformer Note)] -> Code Source #

Add the given calls to the note track scope.

null_call :: Generator Note -> Code Source #

Add the given call as the null note call to the note track. This also binds Symbols.default_note, since that's supposed to be the "named" way to call "".

Patch

data Patch Source #

Instances

Instances details
Pretty.Pretty Patch Source # 
Instance details

Defined in Cmd.Instrument.MidiInst

patch_from_pair :: (Patch.Patch, Common.Common ()) -> Patch Source #

Convert patches as emitted by Patch.

named_patch :: Control.PbRange -> InstT.Name -> [(Midi.Control, ScoreT.Control)] -> Patch Source #

Make a patch, with a few parameters that tend to be unique per patch. Controls come last because they are often a long list.

TODO I don't love the name, but patch is already taken by the lens.

default_patch :: Control.PbRange -> [(Midi.Control, ScoreT.Control)] -> Patch Source #

Make a default patch for the synth.

modify

synth_controls :: [(Midi.Control, ScoreT.Control)] -> [Patch] -> [Patch] Source #

Annotate all the patches with some global controls.

pressure :: Patch -> Patch Source #

Set a patch to pressure control.

environ

environ :: REnv.ToVal a => EnvKey.Key -> a -> Patch -> Patch Source #

The instrument will also set the given environ when it comes into scope.

default_scale :: Pitch.ScaleId -> Patch -> Patch Source #

The instrument will set the given scale when it comes into scope.

range :: Scale.Range -> Patch -> Patch Source #

Set instrument range.

per-allocation

inst_range :: Scale.Range -> Common.Config -> Common.Config Source #

Like range, but set it in the allocation, not the patch.

allocations

config :: [Patch.Addr] -> Patch.Config Source #

Create an incomplete Config. It's incomplete because it doesn't have the Settings from Patch.patch_defaults, so it'll need to have those applied when it gets applied to state_allocations.

config1 :: Midi.WriteDevice -> Midi.Channel -> Patch.Config Source #

Specialize config for a single Addr.

types

type Load = Path.AppDir -> IO (Maybe Synth) Source #

Instrument definition modules that need to load from disk export a function called load, with this signature. Use the AppDir to find instrument_dir.

type MakeDb = Path.AppDir -> IO () Source #

Some synths may require a more expensive load, e.g. they could parse a directory full of sysex dumps. These expose a make_db function with this type. As with Load, the FilePath is instrument_dir. The function is expected to do its work and save the results in the instrument dir

You should use save_synth, which will put the file into instrument_cache_dir with the same name as the synth.