Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

Instrument.Parse

Description

Functions to parse MIDI patch files.

Synopsis

Documentation

type Parser st a = Parse.ParserS st a Source #

annotation file

parse_annotations :: FilePath -> IO (Either String (Map InstT.Qualified [Annotation])) Source #

Format is synth/inst-name tag1=x tag2=y.

TODO other attributes are not supported, but if there were, they could look like *pb-range=12 *flag=pressure

lexeme :: Parser st a -> Parser st a Source #

p_eol :: Parser st () Source #

patch file

patch_file :: FilePath -> IO [Sysex.Patch] Source #

Parse a simple ad-hoc text file format to describe a synth's built-in patches.

Each line should look like inst-name, tag=val, tag=val, .... The instrument name can contain any character except a comma, but the tags are restricted to [a-z0-9-]. The category tag is treated specially: if not set it will be inherited from the previous category.

The patch's program change is incremented for each patch. A line like *bank num sets the bank number and resets the program change to 0.

Comments start with #, and blank lines are ignored.

data State Source #

Constructors

State 

Instances

Instances details
Show State Source # 
Instance details

Defined in Instrument.Parse

Methods

showsPrec :: Int -> State -> ShowS #

show :: State -> String #

showList :: [State] -> ShowS #

data PatchLine Source #

Instances

Instances details
Show PatchLine Source # 
Instance details

Defined in Instrument.Parse