Karya, built on 2018-02-23T20:23:55 (patch cf8565b7ac832266878af99a942555d139065f12)

Cmd.Instrument.MidiInst

Description

Utilities for the instrument definitions in Local.Instrument.

Synopsis

# code

data Code Source #

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

Constructors

 Code Fields

Instances

 # Methods(<>) :: Code -> Code -> Code #stimes :: Integral b => b -> Code -> Code # # Methodsmappend :: Code -> Code -> Code #mconcat :: [Code] -> Code # # MethodsformatList :: [Code] -> Doc Source #

data Call d Source #

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

Add the given calls to the note track scope.

Add the given calls to the note track scope.

Add the given call as the null note call to the note track. This also binds n, since n is supposed to be the "named" way to call "".

# Patch

data Patch Source #

Constructors

 Patch Fields

Instances

 # MethodsformatList :: [Patch] -> Doc Source #

Make a patch. Get the name from Patch.patch_name. TODO: pass the name independently

Convert patches as emitted by Patch.

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.

Make a default patch for the synth.

## modify

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

Annotate all the patches with some global controls.

Set a patch to pressure control.

## environ

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

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

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

Set instrument range.

# allocations

Arguments

 :: [(Score.Instrument, Text, Common.Config -> Common.Config, UiConfig.Backend)] (inst, qualified, set_config, backend) -> UiConfig.Allocations

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.

Specialize config for a single Addr.

Merge an incomplete allocation with defaults from its instrument.

# db

save_synth :: FilePath -> InstTypes.SynthName -> [Patch] -> IO () Source #

Some instruments want to load their patches in elaborate slow ways, like parsing a directory full of sysexes. These patches can export a make_db function, which will do the slow parts and save the results in a cache file. The load function will simply read the cache file, if present.

check_names :: [Patch] -> (Map InstTypes.Name Patch, [InstTypes.Name]) Source #

Like generate_names, but don't drop or rename duplicates, just report them as errors.

generate_names :: [Patch] -> (Map InstTypes.Name Patch, [Text]) Source #

inst_name is the name as it appears on the synth, so it's not guaranteed to be unique. Also, due to loading from sysexes, there may be duplicate patches. Generate valid names for the patches, drop duplicates, and disambiguate names that wind up the same.

People like to put wacky characters in their names, but it makes them hard to type.