for programming the time occurrence of sounds using functions
a small scheme usage example can be found in the readme of sph-sp-guile
index is an array where elements are events for an evenly sized part of a timespan in order. the number of elements is defined by
round(index-duration * index-size-factor).
events are taken from index and added to state-input as they become relevant
i-f :: time index-start -> integer:offsetthat returns a numeric index in data for a time value
output for one event
the main state value of seq
((event-name . user-value) ...),
seq is the main function and others are helper functions
seq calls sample generating functions at customisable times, shares state values between event-f and mixes output values to create a single result. the data type seq returns is user defined via event-f and seq-mixer. seq is called for each sample or segment with the time as argument. if no valid index is loaded, events-f is called to get relevant events. events that are active for the given time have their event-f called. slow-down and speed-up can be done by factor multiplying the time value
seq. usually this would be the smallest element that a call to
seqshall return, for example a sample value or an array of sample values
event-f creates one mixer input element and can update the seq-state and the event specific event-state. event-f are used until they return false, so that the duration is easier to modulate. by updating seq-state, it can add new events to the active event list. event-state and output value will be accessible to other event-f. for example for modulation
example: event could return samples for a sound and event-state would be a dictionary that contains the current frequency. other events can be modulated by the returned samples or values in the event-state
time-range-end: time-range-start plus index-duration
returns events to be added to the index
generate is a different function related to seq.
it calls a function for each time interval in a duration.
for example, it can be used to call
seq once per sample or an array of samples.
maps time to a single sample value
maps time to an array of sample values. the array is either set by sample-f, or if sample-f is false, set to zeros.
i previously wrote sph-upcoming which can generate and filter arbitrary calendar event sequences (for example give the date of time of the next occurrence of an event that starts at date x, repeats every 20 minutes but not on mondays). i spent years using the fruity loops sequencer and trying to automate effects with available frontend tools, i also have experience with sequencer programming using puredata (similar to max/msp)
should be possible
yes, seq-state-output contains all output values associated with the name of the event that returned it
for example when an event depends on another event-state that has not been created or updated yet
a: only by the order they are returned from events-f