0[6      !"#$%&'()*+,-./012345 Safe345F6-All recognized note alias in ascending order.75Modifiers specifying how to modulate some parameters. 689:;<=>?@A7 689:;<=>?@A7 689:;<=>?@A7Safe-/345F5Fundamental type representing an atom for evaluation.!Single value, evaluates to itself$Universal container for other values1Multivalue, the way to introduce varying elementsConditional multivalueOCollection of elements for evaluation, representation of some aspect of voice.BBSafe345FkSyntactic element corresponds to language features. Some of them have direct corresponding constructor in  &, others have to be simplified first. Literal valueSection  Multivalue Conditional multivalue Reference (name of variable) Range of values Product of principlesDivision of principlesSum of principlesSubtraction of principlesLoopRotationReversed principleCSyntax tree in our case is just a collection of syntactic elements.     None345FUStatement can be either definition or exposition. Expositions are only used in REPL.CTest if given fragment of MIDA code is finished and self-contained.Entry point for MIDA parsing. Name of file Text to parse"Error message or parsed statementsCDEFGHIJKLMNOPQRSTUVWXYZ[CDEFGHIJKLMNOPQRSTUVWXYZ[None345F=Render a statement. This handles definitions and expositions.Render definition.Render syntax tree.Show principle. This is useful for printing of simplified principles back to user. We can use the same pretty-printing algorithm as for syntax trees, but this requires us to perform transformation from  to , which is trivial.\This is used by $. It just creates lazy text builder.]+Convert syntax tree into lazy text builder.^,Convert principle to syntax tree to show it._1Pad given string with single space on both sides.Reference name Syntax tree$Textual representation of definition\Reference name Syntax tree%Lazy text builder for this definition]^_\]^_None345CF>Type class for things that can be considered MIDA environment."Get collection of all definitions. #Update definitions with given ones.!Set random generator seed.">Split current random generator, update it, and return new one.#'Monad that implements MIDA environment.`qType synonym for collection of definitions, where a definition is a pair of variable name and corresponding AST.aiMIDA environment state. Basically this amounts to collection of definitions and random number generator.bCollection of definitionscRandom generator$&Run state monad with MIDA environment.d(Default definitions in MIDA environment.%(Add a new definition to the environment.&!Remove definition given its name.'?Remove all definitions, restoring default state of environment.(3Get principle corresponding to given variable name.)-Get source code of definition given its name.*5Reconstruct source code for all existing definitions.+.Get all reference names defined at the moment.evThis performs definition traversal  and returns collection of definition names that given reference name depends on.,ePurge environment removing definitions that are not used in construction of top-level  definitions.-9Check if definition with given name is depends on itself.fJTurn collection of definition names into collection of empty definitions. !"#gh`aibc$d%Reference nameAST of its principle&Reference name'(Reference name Syntax tree)Reference name%Textual representation of source code*+eReference name DefinitionsCollection of definition names,Top-level definitions-Reference nameIts syntax treefjkl !"#$%&'()*+,-# !"$%&'()*+,- !"#gh`aibc$d%&'()*+e,-fjklNone345Fm;State record used for calculation/evaluation of principles.nRecently evaluated valuesoLocal random generator.#Evaluate definition given its name./Evaluate given syntax tree.p*Resolve principle into stream of naturals.qRun lazy state monad with m state.r$Random choice between given options.sCheck if given elements matches  history of generated values. This is for conditional multivalues, see manual for more information.=Note: head of history is the most recently evaluated element.tBConvert internals of conditional multivalue into plain multivalue.uA monadic wrapper around s.vAdd evaluated value to history.0 Transform  into B applying all necessary transformations and resolving references.w~Simplify section. There are several simple transformations that are proven to preserve the same resulting stream of naturals.x#Basic simplification of principles.ynSimplification of single element. Note that single element can produce several elements after simplification.z*The meat of the algorithm that transforms  into .{Saturated division.|Saturated subtraction.}Concept of looping.~Concept of rotation."Concept of reversion for elements.mno.Reference name)Infinite stream of naturals or empty list/ Syntax tree)Infinite stream of naturals or empty listpPrinciple in questionStream of naturalsq Monad to runInitial random generatorResultrOptions to choose fromResults#History of already evaluated valuesElement to testDoes it match the history?tPattern/result pairsInternals of plain multivalueuStream of elements to testDo they match history?v0Syntax tree to transformResulting principlewxyzSyntax tree to transformResulting principle{|}~./0./0mno./pqrstuv0wxyz{|}~ None345F None345F(  !"#$%&'()*+,-./0( # !"$%&'()*+,-./0None345F+.A synonym for what we use as track definition.Modulation figures.Static: no modulation#First ascending and then descending#First descending and then ascending Ascending for the whole duration!Descending for the whole durationMModulation parameters. This defines how sound will be modulated (if at all). Value or amplitude of modulationFigure or shape of modulationDuration in ticks Channel indexProducer function#Boundaries for ascending modulation$Boundaries for descending modulationI is collection of all parameters needed to generate complete MIDI track.Duration streamVelocity stream Pitch streamOptional modulation streamOptional breath streamOptional aftertouch streamOptional pitch bend stream'Apply transformation on all streams in .Default modulation parameters.4Default modulation parameters for breath modulation.8Default modulation parameters for aftertouch modulation.8Default modulation parameters for pitch bend modulation.1)Generate MIDI file from MIDA environment.$Generate MIDI track given its index.'Check if all necessary components in a  are defined.LTake some part (determined by number of ticks) of every infinite stream in  making it finite.Generate MIDI  from .(Merge several tracks together. There is  I thing, but I'm not sure it does it right, moreover it's not documented.Merge just two tracks.AGenerate track fragment representing modulation of one parameter.1Transform modulation parameters into fragment of .!Generate static stream of values.LGenerate up-down  or down-up  stream of values (i.e. returning stream ).!Generate linear stream of values.2Calculate one point from stream of integer values.2&Collection of top-level  definitions.Maximal voice index. 15( means that we can have 16 voices total.41Seed for random generator)Q value: number of ticks per quarter note#Duration in number of quarter notes MIDI file Track index for this trackRequested duration in ticks of infinite streams of finite streamsBatchChannel number Result track Raw modulation value, if present$Duration in ticks of entire fragment Channel indexDefault modulation parametersResult fragmentBeginning and end valuesAmplitude (from 0 to 127)Resulting streamBeginning and end values"Total number of elements in streamAmplitude (from 0 to 127)Resulting streamBeginning and end values"Total number of elements in streamAmplitude (from 0 to 127)Resulting streamBeginning and end values Numerator DenominatorValue of this point2121212None345F39Collection of configuration parameters. They are kept as !s and then converted on request.4gLookup a value from configuration parameters. Type of result determines how value will be interpreted.5Parse configuration file.34&Collection of configuration parametersName of parameter to lookupFallback valueResult5345354345  !"#$%&'()*+,-./0123456789:;<=>?@ABC D E F G H I J K L M N OPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrst1uovwxyz{|}~yTUhimida_HIezaBHeOpU2ZZdbEonKxrMida.Language.ElementMida.Language.SyntaxTreeMida.Representation.ParserMida.Representation.ShowMida.Language.EnvironmentMida.Language.Eval Mida.MidiMida.ConfigurationMida.Representation.BaseElementMida.Representation Mida.Language Codec.MidimergeValSecMulCMul PrincipleSelValueSectionMultiCMulti ReferenceRangeProductDivisionSumDiffLoopRotationReverse SyntaxTree Statement Definition Exposition probeMida parseMida showStatementshowDefinitionshowSyntaxTree showPrincipleHasEnvgetDefssetDefs setRandGen newRandGenMidaEnv runMidaEnvaddDefremDef clearDefsgetPringetSrcfullSrcgetRefspurgeEnv checkRecurevalDefevaltoPringenMiditopDefsParams lookupCfg parseConfig noteAlias modifiers commentLine productOp divisionOpsumOpdiffOploopOp rotationOp reverseOprangeOpdefOp$fApplicativeElementpSource pDefinition pExposition pIdentifier pOperator pPrinciplepElementpRangepValuepNatural pReferencepSectionpMultipCMulti pExpressionoptTableanglesbracesbracketscommanaturalparenssymbollexemescshowDefinition'showSyntaxTree' toSyntaxTreepadDefs MidaEnvStmeDefs meRandGen defaultDefstDefstoDefs unMidaEnv$fHasEnvReaderT$fHasEnvStateT$fHasEnvMidaEnvCalcSt clHistory clRandGenresolverunCalcchoice condMatchtoMul matchHistory addHistory simplifySecsimplify simplifyElttoPrin'sdivsdiflooprotatereverse'TrackFigure FigStatic FigUpDown FigDownUpFigUpFigDown ModParamsmpValuempFigure mpDuration mpChannel mpProducer mpUpBounds mpDnBoundsBatchbtDurbtVelbtPch_btMod_btBth_btAft_btBndmodPbthPaftPbndPrequestdefinedslicetoTrack mixEventsmixPairfigurefigfigStcfigRtnfigLindrawmvIndexdefDurdefVeldefPchdefModdefBthdefAftdefBndbaseGHC.BaseStringParsable parseValuepConfigpItempStringpThing$fParsableBool$fParsableNatural $fParsable[]