Safe Haskell | Safe-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.
Synopsis
- integrate_file :: Cmd.CmdT IO (Maybe Id.BlockId)
- integrate_score :: Ui.M m => Text -> Score -> m (Maybe Id.BlockId)
- insert_at_selection :: FilePath -> Cmd.CmdT IO ()
- insert :: Ui.M m => Score -> Id.BlockId -> Id.TrackId -> ScoreTime.TrackTime -> m ()
- note_track :: ScoreTime.TrackTime -> Score -> ModifyNotes.NoteTrack
- type Score = [(Double, Double, Text, Double)]
- score :: Score
- read_score :: FilePath -> Cmd.CmdT IO Score
- parse_score :: Text -> Either Text Score
Documentation
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.
integrate_score :: Ui.M m => Text -> Score -> m (Maybe Id.BlockId) Source #
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 ()
insert :: Ui.M m => Score -> Id.BlockId -> Id.TrackId -> ScoreTime.TrackTime -> m () Source #
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.