Safe Haskell | Safe-Inferred |
---|
REPL Cmds dealing with instruments and MIDI config.
Synopsis
- lookup :: Util.Instrument -> Cmd.CmdL (Maybe Cmd.ResolvedInstrument)
- lookup_allocation :: Ui.M m => Util.Instrument -> m (Maybe UiConfig.Allocation)
- get_allocation :: Ui.M m => Util.Instrument -> m UiConfig.Allocation
- allocated :: Ui.M m => m [ScoreT.Instrument]
- list :: Cmd.M m => m Text
- list_midi :: Cmd.M m => m [Util.Instrument]
- list_like :: Cmd.M m => Text -> m Text
- pretty_alloc :: ScoreT.Instrument -> REnv.Environ -> UiConfig.Allocation -> [Text]
- pretty_settings :: Patch.Settings -> Text
- show_scale :: Patch.Scale -> Text
- allocations :: Ui.M m => m UiConfig.Allocations
- newtype Channel1 = Channel1 Int
- to_chan :: Channel1 -> Midi.Channel
- add :: Util.Instrument -> Qualified -> Text -> [Channel1] -> Cmd.CmdL ()
- add_mpe :: Util.Instrument -> Qualified -> Text -> Cmd.CmdL ()
- add_default :: Util.Instrument -> Qualified -> [Channel1] -> Cmd.CmdL ()
- add_config :: Util.Instrument -> Qualified -> [(Patch.Addr, Maybe Patch.Voices)] -> Cmd.CmdL ()
- add_im :: Util.Instrument -> Qualified -> Cmd.CmdL ()
- add_sc :: Util.Instrument -> Text -> Cmd.CmdT IO ()
- add_play_cache :: Text -> Channel1 -> Cmd.CmdL ()
- add_dummy :: Util.Instrument -> Util.Instrument -> Cmd.CmdL ()
- add_dummy_ :: Util.Instrument -> Text -> Cmd.CmdL ()
- allocate :: Cmd.M m => ScoreT.Instrument -> UiConfig.Allocation -> m ()
- remove :: Util.Instrument -> Cmd.CmdL ()
- deallocate :: Cmd.M m => ScoreT.Instrument -> m ()
- merge :: Cmd.M m => Bool -> UiConfig.Allocations -> m ()
- replace :: Cmd.M m => UiConfig.Allocations -> m ()
- rename_qualified :: Cmd.M m => Util.Instrument -> Qualified -> m ()
- rename :: Ui.M m => Util.Instrument -> Util.Instrument -> m ()
- copy :: Ui.M m => Util.Instrument -> Util.Instrument -> m ()
- modify_allocations :: Ui.M m => Util.Instrument -> (UiConfig.Allocation -> Map ScoreT.Instrument UiConfig.Allocation -> Map ScoreT.Instrument UiConfig.Allocation) -> m ()
- mute :: Ui.M m => Util.Instrument -> m Bool
- solo :: Ui.M m => Util.Instrument -> m Bool
- add_environ :: (REnv.ToVal a, Ui.M m) => EnvKey.Key -> a -> Util.Instrument -> m ()
- clear_environ :: Ui.M m => Util.Instrument -> m ()
- set_addr :: Ui.M m => Text -> [Channel1] -> Util.Instrument -> m ()
- set_chans :: Ui.M m => [Channel1] -> Util.Instrument -> m ()
- set_controls :: Ui.M m => [(ScoreT.Control, Signal.Y)] -> Util.Instrument -> m ()
- set_control :: Ui.M m => ScoreT.Control -> Maybe Signal.Y -> Util.Instrument -> m ()
- set_tuning_scale :: Ui.M m => Text -> Patch.Scale -> Util.Instrument -> m ()
- set_control_defaults :: Ui.M m => [(ScoreT.Control, Signal.Y)] -> Util.Instrument -> m ()
- get_scale :: Cmd.M m => ScoreT.Instrument -> m (Maybe Patch.Scale)
- set_scale :: Ui.M m => Patch.Scale -> Util.Instrument -> m ()
- copy_scale :: Cmd.M m => Util.Instrument -> Util.Instrument -> m ()
- pressure :: Ui.M m => Util.Instrument -> m ()
- add_flag :: Ui.M m => Patch.Flag -> Util.Instrument -> m ()
- remove_flag :: Ui.M m => Patch.Flag -> Util.Instrument -> m ()
- reset_settings :: Ui.M m => Util.Instrument -> m ()
- reset_flags :: Ui.M m => Util.Instrument -> m ()
- set_decay :: Ui.M m => Maybe RealTime -> Util.Instrument -> m ()
- set_pb_range :: Ui.M m => Maybe PbRange -> Util.Instrument -> m ()
- get_midi_config :: Ui.M m => ScoreT.Instrument -> m (InstT.Qualified, Common.Config, Patch.Config)
- lookup_midi_config :: Ui.M m => ScoreT.Instrument -> m (Maybe (InstT.Qualified, Common.Config, Patch.Config))
- modify_config :: Ui.M m => (Common.Config -> Patch.Config -> ((Common.Config, Patch.Config), a)) -> Util.Instrument -> m a
- modify_midi_config_ :: Ui.M m => (Patch.Config -> Patch.Config) -> Util.Instrument -> m ()
- modify_common_config :: Ui.M m => (Common.Config -> (Common.Config, a)) -> Util.Instrument -> m a
- modify_common_config_ :: Ui.M m => (Common.Config -> Common.Config) -> Util.Instrument -> m ()
- get_instrument_allocation :: Ui.M m => ScoreT.Instrument -> m UiConfig.Allocation
- set_attrs :: Cmd.M m => Text -> Util.Instrument -> m ()
- find :: Cmd.M m => Text -> m [Text]
- set_instrument :: Cmd.M m => Qualified -> m ()
- block_instruments :: BlockId -> Cmd.CmdL [ScoreT.Instrument]
- device_of :: ScoreT.Instrument -> Cmd.CmdL Midi.WriteDevice
- read_devices :: Cmd.CmdL [(Midi.ReadDevice, [Midi.ReadDevice])]
- write_devices :: Cmd.CmdL [(Midi.WriteDevice, [Midi.WriteDevice])]
- connect_read_device :: Midi.ReadDevice -> Cmd.CmdL Bool
- disconnect_read_device :: Midi.ReadDevice -> Cmd.CmdL Bool
- run_interface :: (Interface.Interface -> IO a) -> Cmd.CmdL a
- save :: FilePath -> Cmd.CmdL ()
- load :: FilePath -> Cmd.CmdL ()
- load_merge :: FilePath -> Cmd.CmdL ()
- teach :: Text -> Channel1 -> Midi.Control -> Cmd.CmdL ()
- type Qualified = Text
- parse_qualified :: Cmd.M m => Qualified -> m InstT.Qualified
- initialize_all :: Cmd.CmdT IO ()
- need_initialization :: Ui.M m => m Text
- inst_initialization :: Ui.M m => ScoreT.Instrument -> m (Maybe Patch.Initialization)
- initialize_inst :: Cmd.M m => ScoreT.Instrument -> m ()
- initialize_realtime_tuning :: Cmd.M m => ScoreT.Instrument -> m ()
- initialize_nrpn_tuning :: Cmd.M m => ScoreT.Instrument -> m ()
- get_tuning_map :: Cmd.M m => ScoreT.Instrument -> m [(Midi.Key, Midi.NoteNumber)]
- initialize_midi :: Cmd.M m => ScoreT.Instrument -> Patch.Addr -> m ()
- send_midi_initialize :: Cmd.M m => ScoreT.Instrument -> Patch.Addr -> Patch.InitializePatch -> m ()
- sc_initialize :: Cmd.CmdT IO ()
- sc_initialize_patches :: [Sc.Patch.Patch] -> Cmd.CmdT IO ()
get
lookup_allocation :: Ui.M m => Util.Instrument -> m (Maybe UiConfig.Allocation) Source #
get_allocation :: Ui.M m => Util.Instrument -> m UiConfig.Allocation Source #
allocated :: Ui.M m => m [ScoreT.Instrument] Source #
List all allocated instruments.
list_midi :: Cmd.M m => m [Util.Instrument] Source #
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.
pretty_settings :: Patch.Settings -> Text Source #
show_scale :: Patch.Scale -> Text Source #
allocations :: Ui.M m => m UiConfig.Allocations Source #
Instrument allocations.
add and remove
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.
Instances
Enum Channel1 Source # | |
Num Channel1 Source # | |
Show Channel1 Source # | |
Eq Channel1 Source # | |
to_chan :: Channel1 -> Midi.Channel Source #
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_config :: Util.Instrument -> Qualified -> [(Patch.Addr, Maybe Patch.Voices)] -> Cmd.CmdL () Source #
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.
deallocate :: Cmd.M m => ScoreT.Instrument -> m () Source #
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.
replace :: Cmd.M m => UiConfig.Allocations -> m () Source #
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.
copy :: Ui.M m => Util.Instrument -> Util.Instrument -> m () Source #
modify_allocations :: Ui.M m => Util.Instrument -> (UiConfig.Allocation -> Map ScoreT.Instrument UiConfig.Allocation -> Map ScoreT.Instrument UiConfig.Allocation) -> m () Source #
Common.Config
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
set_controls :: Ui.M m => [(ScoreT.Control, Signal.Y)] -> Util.Instrument -> m () Source #
set_control :: Ui.M m => ScoreT.Control -> Maybe Signal.Y -> Util.Instrument -> m () Source #
set_tuning_scale :: Ui.M m => Text -> Patch.Scale -> Util.Instrument -> m () Source #
set_control_defaults :: Ui.M m => [(ScoreT.Control, Signal.Y)] -> Util.Instrument -> m () Source #
Midi.Patch.Config settings
get_scale :: Cmd.M m => ScoreT.Instrument -> m (Maybe Patch.Scale) Source #
set_scale :: Ui.M m => Patch.Scale -> Util.Instrument -> m () Source #
copy_scale :: Cmd.M m => Util.Instrument -> Util.Instrument -> m () Source #
pressure :: Ui.M m => Util.Instrument -> m () Source #
add_flag :: Ui.M m => Patch.Flag -> Util.Instrument -> m () Source #
remove_flag :: Ui.M m => Patch.Flag -> Util.Instrument -> m () Source #
reset_settings :: Ui.M m => Util.Instrument -> m () Source #
Reset all settings back to instrument defaults.
reset_flags :: Ui.M m => Util.Instrument -> m () Source #
set_pb_range :: Ui.M m => Maybe PbRange -> Util.Instrument -> m () Source #
util
get_midi_config :: Ui.M m => ScoreT.Instrument -> m (InstT.Qualified, Common.Config, Patch.Config) Source #
lookup_midi_config :: Ui.M m => ScoreT.Instrument -> m (Maybe (InstT.Qualified, Common.Config, Patch.Config)) Source #
modify_config :: Ui.M m => (Common.Config -> Patch.Config -> ((Common.Config, Patch.Config), a)) -> Util.Instrument -> m a Source #
modify_midi_config_ :: Ui.M m => (Patch.Config -> Patch.Config) -> Util.Instrument -> m () Source #
modify_common_config :: Ui.M m => (Common.Config -> (Common.Config, a)) -> Util.Instrument -> m a Source #
modify_common_config_ :: Ui.M m => (Common.Config -> Common.Config) -> Util.Instrument -> m () Source #
get_instrument_allocation :: Ui.M m => ScoreT.Instrument -> m UiConfig.Allocation Source #
Cmd.EditState
find
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.
run_interface :: (Interface.Interface -> IO a) -> Cmd.CmdL a Source #
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.
parse_qualified :: Cmd.M m => Qualified -> m InstT.Qualified Source #
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.
inst_initialization :: Ui.M m => ScoreT.Instrument -> m (Maybe Patch.Initialization) Source #
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.
initialize_nrpn_tuning :: Cmd.M m => ScoreT.Instrument -> m () Source #
Like initialize_realtime_tuning
, except use Midi.nrpn_tuning
.
get_tuning_map :: Cmd.M m => ScoreT.Instrument -> m [(Midi.Key, Midi.NoteNumber)] Source #
initialize_midi :: Cmd.M m => ScoreT.Instrument -> Patch.Addr -> m () Source #
send_midi_initialize :: Cmd.M m => ScoreT.Instrument -> Patch.Addr -> Patch.InitializePatch -> m () Source #
sc_initialize :: Cmd.CmdT IO () Source #
sc_initialize_patches :: [Sc.Patch.Patch] -> Cmd.CmdT IO () Source #