Karya, built on 2020-11-26T21:03:17 (patch 23b5be2d53a9e8e7d6136cda5aae2849abe5cded)
Safe HaskellNone



Cmds to add notes to a note track.

This module is sister to Derive.Note since it edits events that Derive.Note parses.

Note events are usually given a duration of the current time step. If a "trigger only" instrument (e.g. percussion) is in scope, they are created with zero duration. Also, starting a raw edit with space will create a zero duration event.


val edit

data ControlTrack Source #

A control track belonging to the note track. This can be a pitch track, or a dyn track.


Instances details
Eq ControlTrack # 
Instance details

Defined in Cmd.NoteTrack

Show ControlTrack # 
Instance details

Defined in Cmd.NoteTrack

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

The val edit for note tracks edits its pitch track (possibly creating one if necessary), and creates a blank event on the note track. It may also edit multiple pitch tracks for chords, or record velocity in addition to pitch.

If I'm in chord mode, try to find the next track and put notes there. If there is no appropriate next track, the cmd will throw an error.

next_control_track Source #


:: Cmd.M m 
=> BlockId 
-> Types.TrackNum 
-> (Text -> Bool) 
-> m (ControlTrack, Bool, Maybe Types.TrackNum)

(selected_track_pair, should_create, next_control_track)

Find the next available control track. Available means it is the given track or is to its right, has either the same instrument or has the default instrument, and doesn't already have a note_id associated with it.

If none is found, return the tracknum at which one should be created.

this_control_track :: Cmd.M m => BlockId -> Types.TrackNum -> (Text -> Bool) -> m (ControlTrack, Bool) Source #

The given track should be a note track. Figure out if it has a control track, or if one should be created.

should_create_control :: Cmd.M m => BlockId -> Info.Track -> (Text -> Bool) -> m (ControlTrack, Bool) Source #

Find the ControlTrack of the given note Track. If there is none, return the tracknum where you should create one.

find_pitch_track :: Cmd.M m => InputNote.NoteId -> m (Maybe (Types.TrackNum, TrackId)) Source #

Find the pitch track associated with the given NoteId, if one exists.

method edit

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

Method edit is redirected to the pitch track, creating one if necessary.


create_pitch_track :: Cmd.M m => BlockId -> ControlTrack -> m () Source #

Create a pitch track.

ensure_note_event :: Cmd.M m => EditUtil.Pos -> m () Source #

Ensure that a note event exists at the given spot. An existing event is left alone, but if there is no existing event a new one will be created.

triggered_inst :: Cmd.M m => Maybe ScoreT.Instrument -> m Bool Source #

Instruments with the triggered flag set don't pay attention to note off, so I can make the duration 0.

get_state :: Cmd.M m => (Cmd.EditState -> a) -> m a Source #