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





cmd_val_edit :: Cmd.M m => Msg.Msg -> m Cmd.Status Source #

Accept keystrokes and modify the val field of the event. Also accept InputNote.NoteOn or InputNote.Control msgs and enter a value based on their velocity or value, respectively. So you can use a MIDI knob to set arbitrary control values.

Since control vals are typically normalized between 0 and 1, this accepts hexadecimal higits and modifies the event text with modify_hex. However, not all tracks are normalized, so this only happens if infer_normalized thinks that it's normalized.

The ' key will enter a ' call, which repeats the last value. This is useful to extend a constant pitch value to the desired breakpoint.

cmd_tempo_val_edit :: Cmd.M m => Msg.Msg -> m Cmd.Status Source #

Editing a tempo track is just like editing a normal control track, except that it doesn't do the hex entry thing.


modify_val Source #


:: (Signal.Y -> Signal.Y) 
-> Text 
-> Maybe Text

Nothing if I couldn't parse out a VNum.

Try to figure out where the note part is in event text and modify that with the given function.

If the val was hex, keep it hex.


data Partial Source #

Partially-parse event text into method, val, and args. Method is actually the call, val is the first argument to the calll, and args are the remaining arguments. Control calls have a convention where the first argument is the value to set. I separate it out so I can replace just that value while leaving any arguments intact. E.g., exponential interpolation might look like e 0 3, where 0 is the destination and 3 is the exponent. Or e (4c) 3 in the case of pitches. If I press a MIDI key I want to replace just the 4c.

The "method" terminology dates from back before calls existed. Nowadays it's just a call, but for that matter so are numeric literals, so I need something to differentiate 1 from i 1.





Instances details
Show Partial Source # 
Instance details

Defined in Cmd.ControlTrack

Eq Partial Source # 
Instance details

Defined in Cmd.ControlTrack


(==) :: Partial -> Partial -> Bool #

(/=) :: Partial -> Partial -> Bool #

parse :: Text -> Partial Source #

Try to figure out the call part of the expression and split it from the rest.

I use a trailing space to tell the difference between a method and a val.

parse_general :: (Text -> Text -> [Text] -> (Text, Text, [Text])) -> Text -> Partial Source #