Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

Cmd.Repl.LInst

Description

REPL Cmds dealing with instruments and MIDI config.

Synopsis

get

allocated :: Ui.M m => m [ScoreT.Instrument] Source #

List all allocated instruments.

list :: Cmd.M m => m Text Source #

List all allocated instrument configs all purty-like.

list_like :: Cmd.M m => Text -> m Text Source #

Pretty print matching instruments:

>pno - pianoteq/ loop1 [1..16]
>syn - sampler/inst 音

pretty_alloc :: ScoreT.Instrument -> REnv.Environ -> UiConfig.Allocation -> [Text] Source #

On the environ, - means it was inherited from the Inst, + is from the Allocation, and * means both had it and the Allocation overrode it.

allocations :: Ui.M m => m UiConfig.Allocations Source #

Instrument allocations.

add and remove

newtype Channel1 Source #

Midi.Channel is 0-based, but DAWs are 1-based, so so use 1-based for UI. list and ultimately Info.show_addrs also display 1-based.

Constructors

Channel1 Int 

add :: Util.Instrument -> Qualified -> Text -> [Channel1] -> Cmd.CmdL () Source #

Allocate a new MIDI instrument. For instance:

LInst.add "m" "kontakt/mridangam-g" "loop1" [1]

This will create an instance of the kontakt/mridangam instrument named >m, and assign it to the MIDI WriteDevice loop1, with a single MIDI channel 0 allocated.

add_default :: Util.Instrument -> Qualified -> [Channel1] -> Cmd.CmdL () Source #

Allocate the given channels for the instrument using its default device.

add_im :: Util.Instrument -> Qualified -> Cmd.CmdL () Source #

Allocate a new Im instrument.

add_play_cache :: Text -> Channel1 -> Cmd.CmdL () Source #

Add the play-cache instrument. This is a dummy instrument used to trigger the play-cache vst. It's emitted automatically if there are im instruments, but needs a channel allocation.

add_dummy :: Util.Instrument -> Util.Instrument -> Cmd.CmdL () Source #

Create a dummy instrument. This is used for instruments which are expected to be converted into other instruments during derivation. For instance, pasang instruments are stand-ins for polos sangsih pairs.

The qualified name still has to name a valid patch, with the Dummy backend.

add_dummy_ :: Util.Instrument -> Text -> Cmd.CmdL () Source #

Like add_dummy except it doesn't require a patch.

allocate :: Cmd.M m => ScoreT.Instrument -> UiConfig.Allocation -> m () Source #

All allocations should go through this to verify their validity, unless it's modifying an existing allocation and not changing the Qualified name.

remove :: Util.Instrument -> Cmd.CmdL () Source #

Remove an instrument allocation.

merge :: Cmd.M m => Bool -> UiConfig.Allocations -> m () Source #

Merge the given configs into the existing ones. This also merges Patch.patch_defaults into Patch.config_settings. This way functions that create Allocations don't have to find the relevant Patch.

modify

rename_qualified :: Cmd.M m => Util.Instrument -> Qualified -> m () Source #

Point an instrument at a different Qualified.

rename :: Ui.M m => Util.Instrument -> Util.Instrument -> m () Source #

Rename an instrument.

Common.Config

mute :: Ui.M m => Util.Instrument -> m Bool Source #

Toggle and return the new value.

solo :: Ui.M m => Util.Instrument -> m Bool Source #

Toggle and return the new value.

add_environ :: (REnv.ToVal a, Ui.M m) => EnvKey.Key -> a -> Util.Instrument -> m () Source #

Add an environ val to the instrument config.

clear_environ :: Ui.M m => Util.Instrument -> m () Source #

Clear the instrument config's environ. The instrument's built-in environ from patch_environ is still present.

Midi.Patch.Config

Midi.Patch.Config settings

reset_settings :: Ui.M m => Util.Instrument -> m () Source #

Reset all settings back to instrument defaults.

util

Cmd.EditState

find

find :: Cmd.M m => Text -> m [Text] Source #

change_instrument

set_instrument :: Cmd.M m => Qualified -> m () Source #

Replace the instrument in the current track with the given one, and initialize_midi it. This is intended for hardware synths which need a program change or sysex. It's called by Instrument.Browser.

device_of :: ScoreT.Instrument -> Cmd.CmdL Midi.WriteDevice Source #

Synths default to writing to a device with their name. You'll have to map it to a real hardware WriteDevice in the write_device_map.

midi interface

read_devices :: Cmd.CmdL [(Midi.ReadDevice, [Midi.ReadDevice])] Source #

Every read device on the system, along with any aliases it may have.

write_devices :: Cmd.CmdL [(Midi.WriteDevice, [Midi.WriteDevice])] Source #

Every write device on the system, along with any aliases it may have.

misc

load_merge :: FilePath -> Cmd.CmdL () Source #

Load and merge instruments. If there are name collisions, the already-allocated instrument wins.

teach :: Text -> Channel1 -> Midi.Control -> Cmd.CmdL () Source #

Send a CC MIDI message on the given device and channel. This is for synths that use MIDI learn.

type Qualified = Text Source #

This is parsed into a Qualified.

initialize

initialize_all :: Cmd.CmdT IO () Source #

Initialize all instruments that need it.

need_initialization :: Ui.M m => m Text Source #

List allocated instruments that need initialization.

initialize_inst :: Cmd.M m => ScoreT.Instrument -> m () Source #

Initialize an instrument according to its Patch.config_initialization.

initialize_realtime_tuning :: Cmd.M m => ScoreT.Instrument -> m () Source #

Send a MIDI tuning message to retune the synth to its Patch.Scale. Very few synths support this, I only know of pianoteq.