آh      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcde f g Safe9:;L hijklmnopqr hijklmnopqr hijklmnopqrSafe249:;L5Fundamental type representing an atom for evaluation.!Single value, evaluates to itself$Universal container for other values1Multivalue, the way to introduce varying elementsConditional multivalueUNon-negative rational number is the best choice for our purposes, hence the synonym.OCollection of elements for evaluation, representation of some aspect of voice.  Safe9:;LUStatement can be either definition or exposition. Expositions are only used in REPL.bSyntactic element corresponds to language tokens. Some of them have corresponding constructor in  &, others have to be simplified first. Literal valueSection MultivalueConditional multivalueReference (name of variable)Range of valuesProduct of principlesDivision of principlesSum of principlesSubtraction of principlesLoopRotationReversed principleCSyntax tree in our case is just a collection of syntactic elements.st ! st !None9:;L&CTest if given fragment of ALGA code is finished and self-contained.'Entry point for ALGA parsing.&' Name of file Text to parse"Error message or parsed statementsuvwxyz{|}~&'&'&'uvwxyz{|}~Safe9:;L (=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.Render non-negative ratio. ()Reference name Syntax tree$Textual representation of definition*+Reference name Syntax tree%Lazy text builder for this definition()*+()*+ ()*+None9:;IL,>Type class for things that can be considered ALGA environment.-"Get collection of all definitions..#Update definitions with given ones./Set random generator seed.0>Split current random generator, update it, and return new one.1'Monad that implements ALGA environment.qType synonym for collection of definitions, where a definition is a pair of variable name and corresponding AST.iALGA environment state. Basically this amounts to collection of definitions and random number generator.Collection of definitionsRandom generator2&Run state monad with ALGA environment.(Default definitions in ALGA environment.3(Add a new definition to the environment.4!Remove definition given its name.5?Remove all definitions, restoring default state of environment.63Get principle corresponding to given variable name.7-Get source code of definition given its name.85Reconstruct source code for all existing definitions.9.Get all reference names defined at the moment.vThis 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.JTurn collection of definition names into collection of empty definitions.,-./0123Reference nameAST of its principle4Reference name56Reference name Syntax tree7Reference name%Textual representation of source code89Reference name DefinitionsCollection of definition names:Top-level definitions;Reference nameIts syntax tree<=>,-./0123456789:;1,-./023456789:;,-./0123456789:;<=>None9:;L;State record used for calculation/evaluation of principles.Recently evaluated valuesLocal random generatorI#Evaluate definition given its name.JEvaluate given syntax tree.*Resolve principle into stream of naturals.Run lazy state monad with  state.$Random choice between given options.Check 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.BConvert internals of conditional multivalue into plain multivalue.A monadic wrapper around .Add evaluated value to history.K Transform  into B applying all necessary transformations and resolving references.~Simplify section. There are several simple transformations that are proven to preserve the same resulting stream of naturals.#Basic simplification of principles.nSimplification of single element. Note that single element can produce several elements after simplification.*The meat of the algorithm that transforms  into .Saturated division.Saturated subtraction.Concept of looping.Concept of rotation."Concept of reversion for elements.IReference name)Infinite stream of naturals or empty listJ Syntax tree'Infinite stream of ratios or empty listPrinciple in questionStream of naturals Monad to runInitial random generatorResultOptions to choose fromResultPattern/result pairsInternals of plain multivalueStream of elements to testDo they match history?KSyntax tree to transformResulting principleSyntax tree to transformResulting principleIJKIJKIJKNone9:;L&'(*+&'(*+None9:;L,,-./0123456789:;IJK,1,-./023456789:;IJKNone!"9:;LMPAutomation track is combination of control values and delta times between them.OValue of parameterP%Delta time (duration of that point )QAspect of automation, it includes simple volume or stereo panorama controls as well as any arbitrary parameters supported by given instrument or effect.RVolume controlS Mute  controlTInput gain controlUStereo panorama controlV'Index of insert slot/index of parameterW%Index of send slot/index of parameterXSynth parameter indexY2Collection of various aspects of automation track.ZOCollection of automation parameters per track. Tracks are identified by names.[&ALGA backend is a function that takes ZM and returns arrow that patches XML configuration accordingly for given DAW.\Check if given track is empty.]-Calculate total duration of automation track.^Generate collection of top-level  definitions (i.e. definitions that are directly represent aspects of automation track, not auxiliary parts in other definitions)._@Patch XML document containing automation settings for given DAW.8Calculate an automation aspect given name of definition.+Evaluate automation aspect if it's defined.XGet sufficient part of infinite stream of numbers in automation track making it finite.?Convert non-negative rational number into floating point value.6Check if given definition name belongs to top-level .WParser of top-level definitions. Returns base name of corresponding automation aspect.%MNOPQRSTUVWXYZ[\]^_ Seed for random number generator!Duration as number of whole notesPath to file to patch"Backed (arrow that will patch XML) Exit code!Duration as number of whole notes'Name of definition of automation aspectAutomation (maybe)!Duration as number of whole notesName of definitionAutomation track (maybe)!Duration as number of whole notesInfinite automation trackFinite automation trackMNOPQRSTUVWXYZ[\]^_[ZYQRSTUVWXMNOP\]^_MNOPQRSTUVWXYZ[\]^_ None9:;LeAdour backend for XML configuration patching. This function says: Please, finish me if you're OK with arrows and you're Ardour user. eeee None!"9:;L0f;Cubase backend for XML configuration patching. This module is result of my reverse engineering sessions with Cubase 5 XML-exported tracks. Due to heavy use of arrows, this is a very dense piece of code that may be difficult to read and understand. HXT documentation and general arrow tutorials should help here.VProcess a track. This first identifies tracks for which we have definitions in given Z#. Every found definition gets its , because Cubase likes to have empty volume automation track in all cases (when we already have volume automation nothing is added, of course).tThen for tracks that are found in XML document and have at the save time automation to add, we need to find GUIDs. - gets list of GUIDs for insert slots, while 9 does the same for synth slots. Then this together with Y is passed to .Process automation track. First we add integer parameter Expanded  with value 1, so automation tracks are visible and obvious then patches docuement is loaded. Then we delete existing automation tracks (they go through 6 arrow), and add various automation events one by one."Calculate volume automation event. Calculate mute automation event.&Calculate input gain automation event.*Calculate stereo panoram automation event.Calculate event+Generate automation event for send  track.Most general way to create automation event. By event we (after Cubase) mean the element representing whole automation track. This may be confusing, so I explicitly mention it here.=Generate automation track element with specified device name.KProduce array of elements corresponding to points in our automation track.AFix range of volume/gain values, so 1 corresponds to 100% volume.Fix duration of every point in automation track. Apart from trivial scaling of values we also transform delta times into start times.sGenerate device name for insertion slot given collection of insertion slot GUIDs and index of this insertion slot.3Generate device name for send slot given its index.EGenerate device name for synth track given collection of synth GUIDs.TGenerate identifier from device name. Algorithm is not very original, but it works.Generate object.Generate member .Generate list.Generate string.=Generate integer (for our purposes it's always non-negative).Generate floating point value.PGeneral way to generate named values (i.e. with name  and value  attributes).Get name of track(s).,Get collection of GUIDs for insertion slots.(Get collection of GUIDS for synth slots.$General utility for GUID extraction. Get string&Filter automation tracks corresponding;Perform some actions on elements with specified class name.Filter lists with given name.2Filter elements which are of one of given classes.;Perform some actions on elements with specified class name.*Filter elements with specified class name. Filter members with given names. Filter items.&This takes arrow to use when input is - value, otherwise it acts as identity arrow. If input is =, XML stream is purged, otherwise given function is applied.nAdd elements/attributes. Input of the second argument is current XML (sub)tree and its result is added to it.:Perform given action on children that have specified name.Safe list indexation.)XML elements that cannot be self-closing.Names of track events.Names of tracks.UFor some reason Cubase likes to have empty automation track for volume in all cases.Multiplier to convert number of whole notes into units understood by Cubase. One quarter note is 480 units, so the whole note is 1920.1f#Collection of automation parametersArrow transforming a trackAspects of an automation trackInsert slots GUIDsSynth slots GUIDs#Arrow transforming automation track<Tags (magic number identifying what this thing will control)+Flags (another magic number, some settings)'Automation track (values + delta times)Insert slot GUIDsIndex of this insert slot Device name Class nameName attribute Identifier AttributesName attribute AttributesName attributeType attribute AttributesName attributeValue attributeName attributeValue attributeName attributeValue attributeType (tag name)Name attributeValue attributeVarying intermediate produceCollection of GUIDsCollection of class names,Arrow that selects elements of those classesThe first arrow2Arrow generating new elements from the first arrow.Arrow combining new elements and existing onesName of elementAction to performResulting arrowff1f759 None9:;Lg(Transform name of DAW into ALGA backend.g[^_g[^_gg    !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[[\]^_`abcdefghijklmnopq r s t u v w x y z { | } ~ ?      !alga-0.2.2-LJ9H6VTc2MgBozHHwMvHWsAlga.RepresentationAlga.Language.ElementAlga.Language.SyntaxTreeAlga.Representation.ParserAlga.Representation.ShowAlga.Language.EnvironmentAlga.Language.EvalAlga.Translation.BaseAlga.Translation.ArdourAlga.Translation.CubaseAlga.TranslationAlga.Representation.BaseElement Alga.Language divisionOpautoDelValSecMulCMulNRatio Principle$fApplicativeElement $fEqElement $fShowElement$fFunctorElement$fFoldableElement Statement Definition ExpositionSelValueSectionMultiCMulti ReferenceRangeProductDivisionSumDiffLoopRotationReverse SyntaxTree$fArbitraryStatement$fArbitrarySel$fEqSel $fShowSel $fEqStatement$fShowStatement probeAlga parseAlga showStatementshowDefinitionshowSyntaxTree showPrincipleHasEnvgetDefssetDefs setRandGen newRandGenAlgaEnv runAlgaEnvaddDefremDef clearDefsgetPringetSrcfullSrcgetRefspurgeEnv checkRecur$fHasEnvReaderT$fHasEnvStateT$fHasEnvAlgaEnv$fShowAlgaEnvSt$fFunctorAlgaEnv$fApplicativeAlgaEnv$fMonadAlgaEnv$fMonadIOAlgaEnv$fMonadStateAlgaEnv$fMonadExceptionAlgaEnv$fMonadThrowAlgaEnv$fMonadCatchAlgaEnv$fMonadMaskAlgaEnvevalDefevaltoPrin $fShowCalcSt AutoTrackatValatDurAutoTypeVolumeMuteIGainPan InsertSlotSendSlot SynthParam AutoBatchAutoMap AlgaBackend nullTracktotalDurtopDefs patchAuto$fShowAutoType $fEqAutoType $fOrdAutoType $fEqAutoTrack$fShowAutoTrack ardourBackend cubaseBackend toBackend extremumAliaspanAlias commentLine productOpsumOpdiffOploopOp rotationOp reverseOprangeOpdefOp arbitrarySel identifierpSource pDefinition pExposition pIdentifier pOperator pPrinciplepElementpRangepValuepLiteral pReferencepSectionpMultipCMulti pExpressionoptTableanglesbracesbracketscommarationalparenssymbollexemescshowDefinition'showSyntaxTree' toSyntaxTreepad pRationalDefs AlgaEnvStaeDefs aeRandGen defaultDefstDefstoDefs unAlgaEnvCalcSt clHistory clRandGenresolverunCalcchoice condMatchtoMul matchHistory addHistory simplifySecsimplify simplifyElttoPrin'sdivsdiflooprotatereverse'toMap evalTrackslicetoFloatisTopRef parseTopRefpTopRef'pTopRefpSuffixpVolumepMutepIGainpPanpInsertpSendpSynthpNum durSuffix procTrackritualVolumeEvent insertGuids synthGuidsprocAuto#hxt-9.3.1.16-K8cCPyES1aM5rb8U4zfDxQControl.Arrow.ArrowListnone volumeEvent muteEvent igainEventpanEventiEvent sendEventaddEvent mkAutoTrack genEventsfixRangefixDur genInsertDN genSendDN genSynthDNgenIDmkObjmkMembermkListmkStringmkIntmkFloat mkNamedVal trackNameguidsIngetStrisATinListisList isAnyClassinClassisClassisMemberisItemmthisbaseGHC.BaseJustmnoneNothing++=/>/!!! nonEmptyElts trackEventstracks durFactorsetInt