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



Functions to deal with tuning instruments.


LTuning.realtime "pno" =<< LTuning.selection True
LTuning.write_ksp (Just "wayang") "charu.ksp"
      =<< LTuning.scale True "raga" "key=charukesi"

nrpn tuning is a lot less hassle than copy pasting KSP everywhere:

LTuning.nrpn "pemade" =<< LTuning.selection True

Don't forget to set the score to the same scale or things will sound confusing. Also, reaper won't receive sysex on a track unless you set it to receive all channels.

To retune all instruments that do tuning via either nrpn or realtime:

LTuning.retune =<< LTuning.selection True


table :: Patch.Scale -> Text Source #

Format a Patch.Scale as a table.

selection Source #


:: Cmd.M m 
=> Bool

False to throw if there are warnings or errors, True to ignore them.

-> m Patch.Scale 

Get a patch scale for the scale at the selection.

scale_at :: Cmd.M m => BlockId -> TrackId -> m (Patch.Scale, [Text]) Source #

Figure out a Patch.Scale by enumerating all inputs to the scale in scope.

named Source #


:: Cmd.M m 
=> Bool

False to check for warnings and errors, True to ignore them.

-> Text 
-> Text 
-> m Patch.Scale 

Create a Patch.Scale for the named scale.

derive :: Cmd.M m => Deriver a -> m (Maybe.Maybe a, [Text]) Source #


retune :: Cmd.M m => Patch.Scale -> m [Util.Instrument] Source #

All instruments with initialization get the new scale.

get_tuning :: Cmd.M m => Util.Instrument -> Patch.Scale -> m Text Source #

Show tuning map for debugging.

realtime :: Cmd.M m => Util.Instrument -> Patch.Scale -> m () Source #

Set the instrument's Scale to the given scale and send a MIDI tuning message with LInst.initialize_realtime_tuning.

nrpn :: Cmd.M m => Util.Instrument -> Patch.Scale -> m () Source #

Just like realtime, but send tuning via LInst.initialize_nrpn_tuning.

write_ksp :: Maybe.Maybe Util.Instrument -> FilePath -> Patch.Scale -> Cmd.CmdT IO () Source #

Write KSP to retune a 12TET patch. Don't forget to do LInst.set_scale to configure the instrument.