bline
Examples
Arguments
initial [number]
The starting value from which to begin stepping. Note that the first bang will not output the initial value, but rather the first linear step in the ramp between the initial value and the target value.
target [number]
The destination value for the ramp. This is the value that will be output on the final step of the ramp.
steps [number]
The number of steps for the ramp. The output of each step is a linear progression from the initial value to the target value.
Inlets
input [bang, number, list]
: advance the ramp to the next step in the current segment and output the value.
: a single number will immediately set bline to the value and output it, stopping the current ramp and clearing any additional segments.
: a list of values can be used to create multi-segment ramps made of two-value pairs that describe the destination value and the number of steps to reach the value. e.g., creates a two-segment ramp that will move from the current value to 0. over 10 bangs, then up to 1. over the next twenty.
Outlets
out1 [number]
The value of the ramp at the current step.
out2 [bang]
Output a bang when bline reaches the destination value. For a multi-segment ramp, output only triggers at the end of the final segment.
Fixed Attributes
These attributes must be set in the object box and determine the behavior of the object at runtime.
initial [number] (default: 0)
The starting value from which to begin stepping. Note that the first bang will not output the initial value, but rather the first linear step in the ramp between the initial value and the target value.
steps [number] (default: 0)
The number of steps for the ramp. The output of each step is a linear progression from the initial value to the target value.
target [number] (default: 0)
The destination value for the ramp. This is the value that will be output on the final step of the ramp.
Dynamic Attributes
These attributes can be modified in the code during execution using the set object
input [bang, number, list]
: advance the ramp to the next step in the current segment and output the value.
: a single number will immediately set bline to the value and output it, stopping the current ramp and clearing any additional segments.
: a list of values can be used to create multi-segment ramps made of two-value pairs that describe the destination value and the number of steps to reach the value. e.g., creates a two-segment ramp that will move from the current value to 0. over 10 bangs, then up to 1. over the next twenty.
stop [bang]
Clear the current ramp and return the object to its initial state without outputting a new value. If an initial ramp is defined using arguments, the next bang will act as the first event in that ramp. If no initial ramp is defined, the next bang will cause bline to output a value of 0.
See Also
Name | Description |
---|---|
bline | Generate ramps using bang |
button | button |
counter | keep count based on input events |
line~ | Linear ramp generator |
metro | metronome |