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



Examples for integrating with external scores. This parses a file in a simple format, but if there generator is in haskell it can also be directly imported.

The easiest way to call the functions in here is to import it into Local/Repl.hs, which should then show up in the REPL.



integrate_file :: Cmd.CmdT IO (Maybe Id.BlockId) Source #

Read score from the file, and create a new block if it's the first time, or integrate changes the next time. Changes made to the file should be merged into the block it creates.

insert_at_selection :: FilePath -> Cmd.CmdT IO () Source #

Insert score at the selection position. This is a plain insert, no fancy integration. It won't clear out any existing notes, so it'll get haphazardly merged if stuff is already there. This is because it's part of ModifyNotes, which is a general way to do score transformations, and it expects its caller ModifyNotes.selection to have cleared the old notes. insert_at_selection :: Cmd.M m => FilePath -> m ()

note_track :: ScoreTime.TrackTime -> Score -> ModifyNotes.NoteTrack Source #

Convert the simple score to ModifyNotes.NoteTrack, which is a generic high level representation of the track structure. Since karya represents pitch and control tracks separately from the notes, they have to be extracted.

type Score = [(Double, Double, Text, Double)] Source #

Simple score with (start, dur, pitch, dyn).