shape~
Time-scaled Breakpoint Envelope Generator
Description
An envelope for the shape~ object can be defined using the same format as the line~ or zigzag~ objects (and edited graphically by connecting a function object). Unlike line~ the time values of shape~ are normalized so that the output occurs within signal ramp of a phasor from 0 to 1 (or 1 to 0). This means you can trigger the output sample-accurately and determine the time of the function by using different ramp durations (or phasor~ frequencies).
Arguments
None.
Attributes
constant[int]
Sets the number of initial segments of the envelope that will be played at a constant time based on their millisecond time values independent of the input ramp duration. The default value for constant is zero, meaning none of the segments will be played with a constant time -- all segments will be scaled. If constant is 1, the first ("attack) segment will have a constant time and the remaining segments will be scaled to occupy the part of the incoming ramp starting when the input value when the constant portion of the output ends. For example, if the first segment is constant and it ends when the input is equal to 0.5, the remaining part of the envelope will be re-normalized to fit into the space between 0.5 and 1.
Note that the constant attribute only works with ascending ramps and can only designate segments at the beginning of an envelope.
curvemode[int]
Sets whether shape~ plays curved breakpoints and how it interprets incoming lists.
Possible values:
0 = 'Off'
(
No curved breakpoints
)
When curvemode is disabled (Off), shape~ interprets incoming lists to set its breakpoints as pairs. If any curved breakpionts were previously set, they are played as linear ramps.
1 = 'On'
(
Use curved breakpoints
)
When curvemode is enabled (On), shape~ interprets incoming lists to be triplets consisting of . All curved breakpoints are output with their curvature.
2 = 'Auto'
(
Use connected function mode setting
)
When curvemode is set to Auto, shape~ determines how to interpret incoming lists on the basis of the mode attribute of a connected function or mc.function object. If mode is set to 0 (Linear), lists are interpreted as pairs. If mode is set to 1 (Curve), lists are interpreted as triplets. If any segments contain non-zero curvature, they are played with their curvature.
In order for Auto mode to work properly, the function object must have its second outlet directly connected to the left inlet of shape.
Common Box Attributes
annotation[symbol]
Sets the text that will be displayed in the Clue window when the user moves the mouse over the object.
background[int]: 0
Adds or removes the object from the patcher's background layer.
adds the object to the background layer, removes it. Objects in the background layer are shown behind all objects in the default foreground layer.
color[4 floats]
Sets the color for the object box outline.
fontface[int]
Sets the type style used by the object. The options are:
plain
bold
italic
bold italic
Possible values:
0 = 'regular'
1 = 'bold'
2 = 'italic'
3 = 'bold italic'
fontname[symbol]
Sets the object's font.
fontsize[float]
Sets the object's font size (in points).
Possible values:
'8'
'9'
'10'
'11'
'12'
'13'
'14'
'16'
'18'
'20'
'24'
'30'
'36'
'48'
'64'
'72'
hint[symbol]
Sets the text that will be displayed in as a pop-up hint when the user moves the mouse over the object in a locked patcher.
ignoreclick[int]: 0
Toggles whether an object ignores mouse clicks in a locked patcher.
jspainterfile[symbol]
You can override the default appearance of a user interface object by assigning a JavaScript file with code for painting the object. The file must be in the search path.
patching_rect[4 floats]: 0. 0. 100. 0.
Sets the position and size of the object in the patcher window.
position[2 floats]
write-only
Sets the object's x and y position in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its size unchanged.
presentation[int]: 0
Sets whether an object belongs to the patcher's presentation.
presentation_rect[4 floats]: 0. 0. 0. 0.
Sets the x and y position and width and height of the object in the patcher's presentation, leaving its patching position unchanged.
rect[4 floats]
write-only
Sets the x and y position and width and height of the object in both patching and presentation modes (if the object belongs to its patcher's presentation).
size[2 floats]
write-only
Sets the object's width and height in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its position unchanged.
textcolor[4 floats]
Sets the color for the object's text in RGBA format.
textjustification[int]
Sets the justification for the object's text.
Possible values:
0 = 'left'
1 = 'center'
2 = 'right'
varname[symbol]
Sets the patcher's scripting name, which can be used to address the object by name in pattr, scripting messages to thispatcher, and the js object.
Messages
int
Converted to
float
in the left inlet defines the the initial value of the function. Without a subsequent message, a single does not cause a new function to be defined (or the existing function to be replaced).
- initial-value
[float]
list
shape~. There are two options for the format of the list, depending on the setting of the curvemode attribute. When curvemode is disabled, the format of the list is in pairs where the first number is a destination value and the second number is the time in milliseconds it takes to get to that value from the previous value. This format (along with an initial value0) is produced by the second outlet of the function object. The millisecond time values are normalized; in other words, they are divided by the total length of the function. Longer times between breakpoints will be longer than shorter times but the exact times will be dependent on the duration of the incoming ramp.
When curvemode is enabled, the list format starts with the initial followed by triplets of numbers -- -- for each breakpoint. The curvature value ranges from -1 to 1.
- breakpoints
[list]
signal
shape~ starts its output when the input ramp either turns on or resets.
See Also
Name | Description |
---|---|
function | Breakpoint function editor |
curve~ | Exponential ramp generator |
line~ | Linear signal ramp generator |
mc.pattern~ | Signal Pattern Sequencer and Recorder |
phasor~ | Generate sawtooth signals |
ramp~ | Trigger a Single Ramp With an Audio Signal |
techno~ | Signal-driven step sequencer |
zigzag~ | Linked list function editor |