Safe Haskell | Safe-Inferred |
---|
Convert a ModT.Module
to Ui.State
.
Synopsis
- data State = State {}
- convert :: Id.Namespace -> ModT.Module -> Either Ui.Error Ui.State
- ky :: Text
- score_track :: IntMap (Id.BlockId, ScoreTime.TrackTime) -> [Int] -> Track.Track
- convert_block :: State -> ModT.Block -> ([Track.Track], ScoreTime.TrackTime, Skeleton.Skeleton)
- make_skeleton :: [[track]] -> Skeleton.Skeleton
- merge_notes :: [Note] -> [(Text, Events.Events)]
- clean_track :: (Text, [Event.Event]) -> Maybe.Maybe (Text, [Event.Event])
- note_event :: Bool -> Note -> Event.Event
- note_pitches :: Note -> [Event.Event]
- nn_to_call :: Pitch.NoteNumber -> Text
- data Note = Note {
- _start :: !ScoreTime.TrackTime
- _duration :: !ScoreTime.TrackTime
- _instrument :: !ModT.Instrument
- _call :: !Text
- _pitch :: !Pitch.NoteNumber
- _controls :: !(Map Control [Event.Event])
- type LineNum = Int
- convert_track :: State -> LineNum -> IntMap ModT.Line -> [Note]
- convert_note :: LineNum -> ModT.Tempo -> ModT.Instrument -> LineNum -> Pitch.NoteNumber -> [ModT.Command] -> [(LineNum, ModT.Line)] -> Note
- note_call :: Int -> [ModT.Command] -> Text
- convert_commands :: ModT.Instrument -> ScoreTime.TrackTime -> [ModT.Command] -> [(LineNum, ModT.Line)] -> [(Control, [Event.Event])]
- group_controls :: [(ScoreTime.TrackTime, (CommandType, Control, Text))] -> [(Control, [Event.Event])]
- type Control = Text
- data Call = Call !Text !Double
- data CommandType
- commands_to_controls :: [ModT.Command] -> [(CommandType, Control, Text)]
- c_dyn :: Control
- c_pitch :: Control
- cut_note :: (LineNum, ModT.Line) -> Maybe.Maybe ScoreTime.TrackTime
- line_start :: LineNum -> ScoreTime.TrackTime
- lines_per_t :: Int
Documentation
convert :: Id.Namespace -> ModT.Module -> Either Ui.Error Ui.State Source #
Make IntMap Instrument map convert_block make @score block using _block_order
score_track :: IntMap (Id.BlockId, ScoreTime.TrackTime) -> [Int] -> Track.Track Source #
Make a score track with calls to the blocks.
convert_block :: State -> ModT.Block -> ([Track.Track], ScoreTime.TrackTime, Skeleton.Skeleton) Source #
Figure out block length from min (max lines) (first cut_block) map convert_track, merge Notes
make_skeleton :: [[track]] -> Skeleton.Skeleton Source #
merge_notes :: [Note] -> [(Text, Events.Events)] Source #
clean_track :: (Text, [Event.Event]) -> Maybe.Maybe (Text, [Event.Event]) Source #
note_event :: Bool -> Note -> Event.Event Source #
note_pitches :: Note -> [Event.Event] Source #
nn_to_call :: Pitch.NoteNumber -> Text Source #
TODO surely this exists elsewhere?
convert
Note | |
|
convert_note :: LineNum -> ModT.Tempo -> ModT.Instrument -> LineNum -> Pitch.NoteNumber -> [ModT.Command] -> [(LineNum, ModT.Line)] -> Note Source #
Figure out note duration: min of time until next line with Pitch>0, or 0fff, or...? Convert Pitch. Collect cmds and convert to Command.
Convert 0d to linear, 01 02 to pitch u
or d
, 03 to pitch linear.
- Interpret timing cmds like 1f.
convert_commands :: ModT.Instrument -> ScoreTime.TrackTime -> [ModT.Command] -> [(LineNum, ModT.Line)] -> [(Control, [Event.Event])] Source #
group_controls :: [(ScoreTime.TrackTime, (CommandType, Control, Text))] -> [(Control, [Event.Event])] Source #
data CommandType Source #
Single cmds emit a single 0 dur event. Grouped cmds emit an event with the given duration as long as they stay the same.
Instances
Show CommandType Source # | |
Defined in Cmd.Load.Mod showsPrec :: Int -> CommandType -> ShowS # show :: CommandType -> String # showList :: [CommandType] -> ShowS # | |
Eq CommandType Source # | |
Defined in Cmd.Load.Mod (==) :: CommandType -> CommandType -> Bool # (/=) :: CommandType -> CommandType -> Bool # | |
Ord CommandType Source # | |
Defined in Cmd.Load.Mod compare :: CommandType -> CommandType -> Ordering # (<) :: CommandType -> CommandType -> Bool # (<=) :: CommandType -> CommandType -> Bool # (>) :: CommandType -> CommandType -> Bool # (>=) :: CommandType -> CommandType -> Bool # max :: CommandType -> CommandType -> CommandType # min :: CommandType -> CommandType -> CommandType # |
commands_to_controls :: [ModT.Command] -> [(CommandType, Control, Text)] Source #
lines_per_t :: Int Source #
Lines per 1 TrackTime.