IX Peer Accumulator 1.4.

Installation

Copy "IX Peer Accumulator.dll" and this document to your Generators folder. That's it. You could add it to your index as well if you like.

What does it do?

It's a trigger style peer controller, mostly intended for adding controllable pseudo-random texture to parameters but you can send fixed values too.

Pseudo-Random?

Each track has two independent pseudo-random number generators which will happily spit out seemingly random values all day long. The values are not truly random however but are generated from a seed value, and for a given seed the number sequence will always be the same. You can control the primary generator's state with various commands that allow you to do things like re-seed the generator or rewind the number sequence to it's start point. The secondary generator is used for probability commands and can only be seeded. When you add a track, the new track's generators are seeded with the current time.

Why "Accumulator"?

It started as a simple machine that would send a peer value only after it had been triggered a certain number of times. It still does that, but I got a bit carried away with the random side of things.

Global Parameters

Command 1 See below.
Argument 1 Value for Command 1. See below.
Command 2 See below.
Argument 2 Value for Command 2. See below.

Track Parameters

Trigger Trigger, possibly.
Delay Delay trigger by n subticks.
SubTicks Sub-tick resolution for trigger delay. Default value is 6 subticks per tick.
Threshold How many times this track must be triggered before it does something.
Mode What to do when the track actually triggers.
Val A/B Value controls.
Track Which track of the target machine to use. Slide it all the way right to target all tracks.
Command 1 See below.
Argument 1 Value for Command 1. See below.
Command 2 See below.
Argument 2 Value for Command 2. See below.

Triggering Modes

Random Successful triggers send a random value in the range between A and B.
Use A Successful triggers will send value A. Useful for tuning the value range.
Use B Successful triggers will send value B. Also useful for tuning the value range.
Alternate Successful triggers will alternate between the values of A and B.

Commands

There are several commands you can use to control Accumulator, either on a global or per-track basis. If you use the global command columns, the command will be applied to all existing tracks. Where two commands on the same line conflict, Command 2 has precedence over Command 1 and Track commands override Global commands. Commands are processed before triggering occurs.

00 - Reset No argument needed. Resets trigger counter, clears all flags and overrides, resets the bitmasks and restarts the number generator.
01 - Set Counter Set trigger counter to argument or reset counter to zero if no argument supplied.
02 - Set Toggle In Alternate mode, sets toggle phase to A or B. Use zero or no argument for A, non-zero for B.
03 - Set Offset Sets the primary random number sequence to the specified step. Use zero or no argument to reset the generator.
04 - Re-seed Seed the primary random number generator with argument. An argument of zero seeds the generator with the current time. If no argument is supplied, the generator is restarted (same as Set Offset to zero).
05 - Ignore Delay A non-zero argument causes the track to ignore any specified subtick delay for subsequent triggers. An argument of zero or no argument clears the flag.
06 - Override (IT) Override (Insert, Temporary). See below.
07 - Override (RT) Override (Replace, Temporary). See below.
08 - Override (IP) Override (Insert, Permanent). See below.
09 - Override (RP) Override (Replace, Permanent). See below.
0A - Clear Override Clears all override settings for this track. No argument needed.
0B - Invert Invert values. Random numbers will be inverted (ie. 100% becomes 0%). Non-zero to activate, zero or no argument to deactivate. Override values are not affected.
0C - Set AND Bitwise AND. Bits that are not set in the argument value will be cleared from sent values. If that makes sense to you then you probably are, or should be, a programmer. This will affect all subsequent values except for overrides and is processed before the bitwise OR. No argument resets the mask.
0D - Set OR Bitwise OR. Bits that are set in the argument value will be set in sent values. Crazy huh? This will affect all subsequent values except for overrides and is processed after the bitwise AND. No argument resets the mask.
0E - Set Mode Sets how values A and B are interpreted. Zero or no argument for Standard, non-zero for Precise. In Standard mode the values of A and B are regarded as percentages of the target parameter's range. In precise mode the values are treated literally and if the value exceeds the parameter's range, it will clamped accordingly. The mode setting is ignored if the target is a note parameter.
0F - Lazy Causes the track to trigger immediately and then automatically every n ticks. See also attribute 'Lazy When Stopped'.
10 - Clear Slave Releases this track from track n.
11 - Set Slave Slaves this track to track n. When track n recieves a trigger, this track will also recieve a trigger. Tracks can be slaved to multiple masters.
12 - Time Seed Seeds the track's random number generators based on the current:
  • 00 - second (0-59)
  • 01 - minute (0-59)
  • 02 - hour (0-23)
  • 03 - day of the week (0-6)
  • 04 - day of the month (1-31)
  • 05 - day of the year (0-365)
  • 06 - month (0-11)
  • 07 - year (since 1900)
  • 10 - second (unique)
  • 11 - minute (unique)
  • 12 - hour (unique)
  • 13 - day (unique)
Unique values are calculated from the number of seconds elapsed since midnight, January 1, 1970 Adding 1000 to the argument will cause the secondary rng to be seeded ie. 1006 == seed secondary generator with current month.
13 - Filter Min Sets the value filter minimum. Values less than the minimum will not be passed to the target. Obeys the mode setting. Filtering is done [i]after[/i] the bitwise AND/OR.
14 - Filter Max Sets the value filter maximum. Values greater than the maximum will not be passed to the target. Obeys the mode setting. Filtering is done [i]after[/i] the bitwise AND/OR.
15 - Secondary Seed Same as re-seed command (04) but affects the secondary rng.
16 - Probability Sets the probability of whether a trigger on this tick will be allowed to happen, where FFFE is 100%. Works on any trigger, regardless of source.
17 - Probability Trigger Sets the probability of a trigger being generated this tick, where FFFE is 100%. Manual or lazy triggers will override this.

Override command modes:

The override commands allow you to override the normal value of a trigger. If no argument is supplied, the value is that of the last successful trigger (ie. hold). The override commands behave in the following ways:

Temporary Overrides only the next successful trigger.
Permanent Overrides all subsequent triggers until the flag is cleared by either a temporary override, 'Clear Override' or 'Reset' command.
Insert Inserts the value into the normal value sequence. Subsequent values are shifted along one place ie. the sequence will resume where it was interrupted.
Replace Replaces the value at this point in the sequence. Subsequent triggers retain their values.

Attributes

MIDI Input Channel Channel to monitor if MIDI filtering is not enabled. Off by default.
MIDI Trigger Base The MIDI note that will trigger the first accumulator track.
Reset On Stop If set, perform a global Reset command when stop button is pressed. Off by default.

Right-click menu

Assign Manage peer assignments.
Style Controls how values A and B will be displayed in the parameters window. This is just an aid for setting up values and has no effect on the actual function of the machine. Please note that although it should work correctly for most machines, it is possible that the 'Note' mode may not accurately a machine's interpretation of the values sent by Accumulator.
Info Launch the status dialog.

Status Dialog Fields

Track Track number. No, you can't give them custom labels.
Assign Shows the current peer assignment.
T/C Threshold and counter state, in that order.
Override Shows current override settings, if any.
Delay Shows whether the track is currently obeying subtick delay.
Invert Shows whether the track's random values are being inverted.
AND Shows the current AND mask. FFFF is no effect.
OR Shows the current OR mask. 0000 is no effect.
Value Displays the last actual value sent to the target parameter after bitwise masking and filters were applied. Value is displayed as both raw hex and interpreted.
Mode Shows whether the track is in Standard or Precise mode.
Lazy If the track is set to lazy triggering, displays the tick interval between triggers.
Filter Displays the track's filter value range.
Slave Shows which tracks the track is slaved to.

Undo behaviour (Buzz 2008 or later)

If a previously assigned machine is restored by an undo operation and the track concerned has no assignment, the old assignment will be restored automatically. If the track has a new assignment, Accumulator will ask whether the old assignment should be restored.

Known Problems

There seems to be an issue when controlling one Accumulator with another in Buzé (probably other libzzub projects too) which can result in unusual triggering. The problem is somehow liked to saving and reloading so if you notice a problem, save the song and reload it and the problem should have gone. Each time you save and reload the file, the problem will alternately be back again or gone. Files saved in Buzé will have the bug in Buzz but a single save/reload will fix the problem permanently but saving a file in Buzz will bring the problem back in Buzé. I'm baffled.

You may experience minor mutex timeout problems in Buzz if you add certain machines to your song while the status dialog is open and Accumulator is active. The problem is worse in Buzé where the program will stop responding.

Acknowledgements

First and foremost, many thanks to Ed Powley for the superb PeerLib upon which this machine is based, and for his seemingly endless patience when faced with stupid noob questions. I have also used the Mersenne Twister random number generator, in the form of MersenneTwister.h by Richard J. Wagner which is in turn based upon code by Makoto Matsumoto, Takuji Nishimura, and Shawn Cokus. Many thanks to those distinguished gentlemen for making their code publicly available to be used by amateurs such as myself. Thanks also to the many developers who frequent The Church whose help, advice and code I have leaned on heavily from day one. Finally, huge thanks to Oskari for making, and now at last re-making, our beautiful, beloved Buzz.

Contact

If you've got any comments, requests, bug reports, whatever, you can find me lurking in The Church or you can mail me via deenine[at]hotmail[dot]co[dot]uk (but don't expect a quick reply.)

Disclaimer

This is the second machine I've made and I'm still strictly amateur so use it at your own risk. If it kills your computer, take comfort in the fact that it'll probably kill mine too.

- IX