WAGON 42: algoritmes

AC Toolbox - Paul Berg








Treinnummers, locomotiefnummers en uurtabellen heb ik (eenvoudigweg) ingevoerd in AC Toolbox. De algoritmes (die mij volledig onbekend waren maar voorzien zijn van uitleg) doen hun werk; ze verstrekken mij audiofragmenten die ik als bijzondere entiteiten beschouw en die geen aanpassingen of bewerkingen dulden. Microtonale pareltjes die de relatie 'van cijfers naar klank' behelst, komen tevoorschijn. Deze uitkomst draagt (in eerste instantie) het onverwachte, het onbestemde of het onbepaalde in zich. Een interessant gegeven, binnen dit intermediaal onderzoek.


(Belangrijk: onderstaande data tonen de (arbitrair) gekozen algoritmes. Helemaal onderaan kan u de uitleg raadplegen, die rechtstreeks werd gecopieerd uit het programma AC Toolbox.)








F1 p10-chromatic-1










F2 locs-7209-parallel









F3 autour-du-7209-minimal












F4 locs-p10-chrom-comb-1









F5 locs50-75-combinations2









F6 loc59









F7 locs50-75-combinations









F8 locs-noise-combination









F9 vertrekuren-ptrain-timed









F10 aankomst-vertrek









F11 p-trein










F12 aankomsturen-ptrain-timed









F13 p10-7209









F14 7209-grow-vertrek










F15 p10-chromatic-2









F16 7209-p10-repetitive-2









F17 combinations-1









F18 noise-choice-7209-min









F19 noise-choice-7209-m









F20 autour-du-7209-dens









F21 7209-repetitive-2









F22 p10-7209-3









F23 noise-choice-7209









F24 7209-repetitive-1









F25 7209-p10-repetitive-1









F26 vertrek-aankomst-7209








F27 autour-du-7209








F28 chords-p10








F29 p10-scale








F30 locs-noise








F31 locs













































































































































































































































Toegepaste ALGORITMES in AC Toolbox:





Returns a closure. VALUE is assumed to be something that could produce a positive value. PROBABILITY is something that could produce a probability value in the range of 0-1. (O is never, 1 is always).


Both VALUE and PROBABILITY can change over time. They can be e.g.  a constant, a list, a stockpile, a generator, etc.


When a value is produced, it may be made a negative number according to the specified probability. Rests in the AC Toolbox are specified as negative numbers. This generator can produce rests or rhythmic values according to the specified probability.








Returns a closure. When applied, it will produce a random value between LOW and HIGH. Integer values for LOW and HIGH produce an integer result. Otherwise a real result is returned (example 3). LOW and HIGH can change over time.


To quantize the result with another unit, bind ROUND to a quantization unit.








Returns a closure. When applied, it will randomly choose one of the elements of the sequence or stockpile. Ideally,  it will produce a uniform random distribution.








Returns a closure. When applied, one element of the stockpile or list is  returned at random. No element is repeated until all elements of the sequence have been returned once. At that moment, the process starts again.


CHECK can be bound to t to force a repetition check to occur. In that case no repetition occurs between the last value chosen from one stockpile and the first value chosen from the replenished stockpile.


If a repetition check is used, the user should make sure that the stockpile from which the selections are made does not contain any repetitions. This could lead to an endless loop since the generator would keep trying to find a different value but none is available.








Returns a closure. When applied, one number between A and Z is returned  according to a fractional-noise distribution. The type of fractional noise is  determined by TYPE which can range from 0 to -4. 


0 is white, -1 is 1/f (or pink), -2 is brownian, and any value < -2 is black.  


The type of the result is determined by the type of A  and Z. N is the total number of values to be generated with this  generator. A, Z, and TYPE may vary over time.








Returns a closure. When applied, a fractional value < 1 is returned.  GENERATOR should return an integer value. METRIC-FRACTIONS returns 1 divided by that value until the sum would be 1. The number 4 would produce 1/4 1/4 1/4 1/4. After the sum is 1, a new divisor is chosen.


GENERATOR can be a generator, list, stockpile, etc. If it produces a non-integer value, that value is truncated to be an integer.


The purpose of this generator is to simplify the rhythmic organization of groups of values.










Returns a closure. When applied, one value is returned which has been mapped from an object, such as a shape, mask, list or stockpile. It does not map generators.


This generator is similar to the tool CONVERT which will map an object into a list with N values within certain limits. 


CONVERT/TIME does NOT return a list. Instead, each time the closure is applied, the next value is returned. For this reason, it makes more efficient use of memory than CONVERT. This can be important if an object is to be converted into a large number of values (e.g. tens of thousands of values which might happen when generating granular score data for Csound or when controlling an external device using streams.) The increase in efficiency primarily occurs with masks.


If LOW or HIGH is a real number, the result will be a real number.  Otherwise, integers are returned.


LOW and HIGH can vary over time. For shapes, this has no effect on the amount of memory used. For masks, changing these parameters over time severely limits efficiency though it is still more effecient than using CONVERT.



A shape will be mapped so that N applications of this generator will return N values ranging from LOW to HIGH.



The list (or stockpile values) will be expanded or contracted so that N applications of this generator will produce N values between LOW and HIGH.



Keyword ROUND can be bound to a quantization unit. The results wil be rounded using that unit (example 3). Values must be entered for all of the optional values before ROUND. Nil can be used to do this.


A more convenient way to round values is with CONVERT/TIME2. This uses keywords instead of optional parameters.



N applications of the generator produce N values between LOW and HIGH. The type of LOW and HIGH determine the type of the result.


The mask is divided into N segments. Each time a new value is needed, the appropriate boundaries are determined. A generator is applied to determine a value between the boundaries. 


The mask in examples 5-6 can be used to produce values between 40 and 80.


By default, the generator used for determining a value between the boundaries is RANDOM-VALUE. Other generators could be used. They should produce a percentage value between 0 and 100.


GENERATOR could also be a list of values between 0 and 100 percent. In that case, CONVERT will loop through the values.


The remaining parameters for CONVERT/TIME (INTERVAL-OR-LIST, PITCH-CLASS  STOP, and PREVIOUS) only work with masks. The usage is identical with their use in CONVERT. See the help for CONVERT for an extended description of these parameters.


CONVERT/TIME is primarily useful when dealing with masks. The gain in speed and memory efficiency is dramatic compared to CONVERT. This gain is achieved when LOW and HIGH do not change over time. If either or both of these parameters change over time, the efficiency gains are much less.


With shapes, speed decreases though there is some gain in reduced memory allocation. For shapes, the primary benefit is that LOW and HIGH can vary over time.








Returns a closure. When applied returns the next value of a dynamical  system, described by the following formula:




This formula describes the growth of a population. It accounts for the  effects of overpopulation and a shortage of food on the size of the next  generation.


The output is the size of the population. The maximum output value is  MAXPOP, the minimum is zero.


START sets the fraction of the maximum size of the population possible. It should be a value in the range 0-1.  This maximum size is determined by MAXPOP. GROWTHFACTOR controls the  behaviour of the system.


The parameter GIANT determines after how many iterations the value is  returned. This can be useful for filling a list with a small number of  values describing the behaviour of the system over a longer period. 


This system is capable of chaotic behavior. This is controled by the  parameter GROWTHFACTOR. The value of GROWTHFACTOR must be a number  between 0.0 and 4.0. For values smaller than about 3.7 the system is  periodic.


For higher values for GROWTHFACTOR, the system is chaotic.


To map the output of this function to useful values, use CONVERT.


GROWTHFACTOR may vary over time.


The keyword FIRST is no longer supported. Its use has no effect.


This generator was contributed by Gijs de Bruin.








Returns a closure. When applied, a geometric or arithmetric series of numbers will be produced. By default, a geometric series (multiplication of the previous value by a growth factor) will occur.


Example 1 is an endless geometric series. The first value is START. The second value is START * GROWTH. The next value is the previous value  * GROWTH. There is no upper limit.


Example 2 is a decreasing series. Each application of the closure with decrease the value. There is no lower limit.


The series can be limited to N values. The value N+1 will again be START.


The series can be clipped to be within the range LOWER and UPPER.


An arithmetic series (adding GROWTH to the previous value) can be realized by binding #'+ to FUNCTION.


All parameters except RESET can vary over time. They can be constants, lists, stockpiles, generators, etc.


If a series has N values and one or more parameters that vary over time, the new parameter values will be produced every N values.


By default, RESET is set to t. If it is bound to nil, the series will continue from its current value instead of resetting the series to the START value. There must be a value for N for this to have any effect.


If START changes over time and RESET is t, then START will receive a new value after each N values.








Returns a closure. When applied, one element of the sequence is returned. The choice of element is made according to a fractional noise distribution.The type of fractional noise is determined by TYPE which can range from 0 to -4. 0 is white, -1 is 1/f (or pink), -2 is brownian, and any value < -2 is black.


N is the (estimated) total number of values to generated with this generator.


TYPE can vary over time.








Returns a closure. When applied, a random value with an exponential distribution is returned. This distribution favors lower values (near THRESHOLD).


The number returned is >= THRESHOLD. There is no theoretical upper limit. If the optional UPPER-BOUNDARY is supplied, the number will be <= to it. The type of  the number is the type of THRESHOLD. GAMMA determines the spread of the distribution and should be > 0. The larger the value of GAMMA, the  greater the probability of producing values near THRESHOLD.


THRESHOLD, GAMMA, and UPPER-BOUNDARY may vary over time. 


To quantize the result with another unit, bind ROUND to a quantization unit (example 7). Note that ROUND is an optional parameter (not a key word) and therefore there must be a value specified for UPPER-BOUNDARY. If no UPPER-BOUNDARY is desired, nil can be entered for it.  


The average value for this distribution is 1/gamma.


EXPONENTIAL-VALUE can be abbreviated to EV.


Another way to produce an exponentially distributed value is with EXPRAND-VALUE. The  algorithm for that generator is more simple and it always producesa result in the specified range.








Returns a closure. When applied, it chooses between values from two adjoining things. The choice could be between a value from THING1 or THING2, or a value from THING2 or THING3, etc. There can be an indefinite number of things from which to choose.


The choice is made using the value of CHOOSER. If CHOOSER is 1 (or less), a choice will be made from THING1. If CHOOSER is 2, a choice will be made from THING2. If CHOOSER is 1.5, there is a 50-50 chance to choose from THING1 or THING2. If CHOOSER is 1.2, there is a greater chance to choose from THING1 than from THING2.


If three things are specified, a value of 2.5 for CHOOSER would cause a choice between THING2 and THING3 to be made.


CHOOSER can vary over time.


THING1, THING2, etc. can be lists, stockpiles, generators, etc.


This generator is similar to the generator INTERPOLATE. The difference is that INTERPOLATE changes over time based on a shape.  CHOOSE-INTERPOLATION could change over time if the value of CHOOSER changed over time.


If a choice is made from values from two lists, the choice is between the first value from THING1 and the first value from THING2. Then the choice is between the second value from THING1 and the second value from THING2. Etc. 


Lists do not need to have the same length. The generator will loop through them to find the next value.


The things to be interpolated can be generators.


If the value for CHOOSER should be derived from a shape or mask, it can be converted using CONVERT.








Returns a closure that 'walks' around starting at number  STARTING-POINT. NEXT-STEP determines the interval to be added.  NEXT-STEP can be a number, sequence, stockpile, or function that should  provide a number. Each time a step is to be taken, a new value  is produced from NEXT-STEP and added to the previous value. 


Optional LOWER and UPPER boundaries can be provided. If the result  would be outside of the boundary, the sign of the value(s)  to be added is reversed and the next result is the amount that would have been outside the boundary but placed inside. Two outside of the boundary would be 2 inside the boundary.


NEXT-STEP, LOWER, and UPPER may change over time. STARTING-POINT may  use a generator to calculate its value.








Returns a closure. A chord is a list of note numbers in either a data section or a note section. This closure, when applied, will produce a list of note numbers that could be used as  chords for either of those two types of sections.


SOURCE-OBJECT can be a list, stockpile, generator etc. capable of  providing numerical values. These values are grouped in succession to produce a chord. If SOURCE-OBJECT is a list and each chord should have 4 values, each successive 4 values are taken from the list. If need be, the closure will wrap around to the beginning of list to get more values.


SIZE-OBJECT indicates the number of pitches to be included in the  chord (list). It may be a constant, generator, stockpile, etc.


Keyword BLOCK will prevent certain intervals from being present in a chord. To do this, BLOCK should be bound to an interval or a list of  intervals. These intervals will be blocked. Before a value is included in a chord, it is checked to see that it does not create a forbidden interval. Intervals are expressed as a number of semitones. 


Some of the chords in example 3 will probably contain a the same pitch more than once.


The chords in example 4 will not contain any pitch doublings, since the unison is blocked.


The chords in example 5 will not contain any unisons or minor thirds.


If unison intervals are blocked, it is still possible that a chord would contain an octave. To prevent this, values should be reduced to their pitch class before the intervals are examined. This can done by binding keyword PITCH-CLASS to t.


If one or more intervals are being blocked, it is the responsibility of the user to make sure that a chord of the desired size can actually be created without using the blocked intervals. The Toolbox will give up after trying STOP number of times. 


If successive chords should not contain common pitches, bind ALLOW-REPEATS to nil. This will prevent the selection of any pitch used in the previous chord. If this is not possible, the Toolbox will give up after STOP number of attempts.


The example 10 prevents repetitions in successive chords but allows a pitch to be used more than once within a chord. The example 11 also blocks the repetition of a pitch within a chord.


Keyword LIMIT can limit the range of the chord to be within ±limit steps of the first value chosen for the chord. The first value chosen for the chord is the last one listed in the printed representation of the chord (examples 12-14). If a value cannot be found within the requested limits, the Toolbox will stop trying after STOP number of attempts.


SOURCE-OBJECT, SIZE-OBJECT, and LIMIT may vary over time.








Returns a closure. When applied returns the next value of a dynamical  system, described by the following formula:





The default output variable is X. By using the keyword EYE the variable Y  is returned. Both variables will be returned in a list by using the  keyword XY.


The parameter GIANT determines after how many iterations the value is  returned. This can be useful for filling a list with a small number of  values describing the behaviour of the system over a longer period.


The system is a driven oscillator with a non-linear compliance term  (Bx^3).


By setting G and OMEGA to zero, the system is non-driven.


The driven oscillator can behave in a chaotic way.


If the damping is large, the transient part of the oscillation will soon fade away.


It is not easy to predict the maximum and minimum of the output  values. To map the output of this function to useful values, use CONVERT.


The initial values for X and Y are not returned. If the initial values should be returned as the first result of the generator, keyword FIRST should be bound to t.


This generator was contributed by Gijs de Bruin.