buffer~ viewer and editor
bang | A bang in any inlet will cause waveform~ to dump/output the value to which it is set specific to the inlet in which the is received. | |
int | display-settings [int] |
Converted to | specific to each inlet.
float | display-settings [float] |
In left inlet: Sets the display start time in milliseconds. Changing this value will offset and/or zoom the view, so that the requested time in the buffer~ sample data is aligned to the left edge of the display. The default is 0 (display starts at the beginning of the target buffer~). In 2nd inlet: Sets the display length in milliseconds. The default is the length of the buffer~. In 3rd inlet: Sets the start time of the selection range in milliseconds. In 4th inlet: Sets the end time of the selection range in milliseconds. |
list | link-data [list] |
In 5th inlet: The 5th inlet provides a link input, which allows any number of waveform~ objects to share their start, length, select start, and select end values. Whenever any of these values changes, waveform~ sends them all as a list out its right outlet. If this outlet is connected to the link input of another waveform~ object, it will be updated as it receives the lists. To complete the circuit, the second waveform~ object's list output can be connected to the link input of the first. Then, changes in either one (via mouse clicks, etc.) will be reflected in the other. This is mainly useful when the waveform~ objects are viewing different channels of the same buffer~. Any number of waveform~ objects can be linked in this fashion, forming one long, circular chain of links. In this case waveform~ will prevent feedback from occurring. |
crop | The buffer~ to the current selection. It resizes the buffer~ to the selection length, copies the selected samples into it, and displays the result at default settings. The buffer~ is erased, except for the selected range. This is a "destructive edit," and cannot be undone. | message will trim the audio data in the target|
bpm | master-tempo and beats-per-bar [list] |
Specifies beats per minute as the time reference unit, relative to a master tempo and number of beats per bar, both of which you can set with the waveform~ can also calculate a tempo that fits your current selection, via the message. | message.
(drag) | Click and drag behavior for the waveform~ object varies according to the object's mode of operation (see the attribute). | |
buftime | drawing-interval (int) [int] |
The word waveform~ object is redrawn due to changes in its associated buffer~ object. Setting a higher number value will make some difference in CPU utilization. The default value is 500ms. | , followed by a number between 20 and 60000, sets the minimum drawing interval in milliseconds when a
mode | mouse-response-mode (symbol) [list] |
This is a legacy message - this functionality is now provided by the | attribute.
(mouse) | The way that the waveform~ object responds to clicking and dragging varies according to how the object is configured using the attribute. | |
mouseoutput | mouse-output-mode (symbol) [list] |
The word - Selection start and end values are not sent in response to mouse activity. Sending the message with no argument has the same effect as the same message with the argument . - Causes the current selection start and end values to be sent (from outlets 3 and 4) only when you click inside the waveform~. - Causes selection start and end to be sent only when you release the mouse button, after clicking inside the waveform~. - Causes selection start and end to be sent both when you click inside the waveform~, and when the mouse button is released. - Causes selection start and end to be sent on click, release, and throughout the drag operation, whenever the values change. |
, followed by a symbol argument, determines when selection start and end values are sent in response to mouse activity. Only the selection start and end (outlets 3 and 4) are affected. Mouse information is always sent from outlet 5, regardless of the mouseoutput mode. Valid symbol arguments are, , , , , and .
line | time (milliseconds) [list] |
The word The word , followed by a symbol, defines the unit used to display the line. The options are: bpm: beats per minute ms: milliseconds (the default) phase: phase (range 0. - 1.0) samples |
, followed by a integer or floating point value representing a time in milliseconds, will cause a vertical line to be superimposed on the waveform display at the millisecond point indicated by the argument. The purpose of this is to be able to visually indicate where the playback point of the waveform is at any given moment. If the argument of is a negative value, the vertical line will be hidden.
name | file-name [list] |
The word waveform~ object to display the channel of that file. This is used for displaying multichannel audio files. | , followed by a list that contains the name of a file and a channel number, sets
normalize | maximum-peak-value [list] |
The word buffer~ so that the highest peak matches the value given by the argument. This can cause either amplification or attenuation of the audio, but in either case, every buffer~ value is scaled, and this activity cannot be undone. | , followed by a float, will scale the sample values in the target
set | buffer-name [list] |
The word buffer~ object, links waveform~ to the target buffer~, which is drawn with default display values. An optional int argument sets the channel offset, for viewing multi-channel buffer~ objects. The name of the linked buffer~ is not saved with the Max patch, so should be stored externally if necessary. | , followed by a symbol or which is the name of a
setbpm | The word waveform~ to calculate a tempo based on the current selection range. It automatically changes the display time unit to bpm, as if you had sent the message . A tempo is selected such that the selection range constitutes a logical multiple or subdivision of the bar, preserving the current beats per bar value, and attempting to find the closest value to the current tempo that satisfies its criteria. When a suitable tempo is selected, the offset parameter is adjusted so that the start time of the selection range falls exactly on a bar line. The result is that the selection area will be framed precisely by a compatible tempo. One use of this technique is to quickly establish time labels and tick marks for a section of audio. After selecting a bar as accurately as possible, sending the message and turning on snap to label allows immediate quantization of the selection range to metric values. If the target buffer~ contains an audio segment that is already cropped to a logical number of beats or bars, the best technique is to select the entire range of the buffer~ (with messages to the select start and end inlets), followed by the message. If the buffer~ is cropped precisely, the resulting tempo overlay should be quite accurate, and immediately reveal the tempo along with metric information. When a new tempo is calculated, it is sent from the rightmost outlet (the link outlet), to update any linked waveform~ objects, and to be used in whatever manner required by the surrounding patch. |
, with no arguments, causes |
snap | snap-mode (symbol) [list] |
The word waveform~ selection range. causes the start and end points of the selection to automatically move to specific points in the buffer~, defined by the snap mode. Possible arguments are , , and . - Disables snap to allow free selection. This is the default. The message with no argument has the same effect. - Specifies that the selection start and end points should snap to the vertical grid lines, as set by the message. Since the spacing of the grid lines is affected by the current time measurement unit, and by the offset value (if an offset has been specified), snap to grid will be affected by these parameters as well. - Causes the selection start and end to snap to the tick divisions specified by the ticks message. - Instead of snapping the selection to a uniform grid, this mode searches for zero-crossings of the buffer~ data. These are defined as the points where a positive sample follows a negative sample, or vice-versa. This can be useful to find loop and edit points. |
, followed by a symbol argument, Sets the snap mode of the
replacebuffercontents | filename [list] |
The word waveform~ object is associated and display the new buffer contents. | , followed by a symbol argument, will replace the current contents of the buffer with which the
undo | This mode works for waveform~ selection only. It causes the selection start and end points to revert to their immediately previous values. This is helpful when you are making fine editing adjustments with the mouse and accidentally click in the wrong place, or otherwise cause the selection to change unintentionally. Repeated commands will toggle between the last two selection states. | |
unit | unit-of-measurement (symbol) [list] |
The word - Sets the display unit to milliseconds. This is the default. - Causes time values to be shown as sample positions in the target buffer~. The first sample is numbered 0, unless the display has been shifted by the message. - Causes time to be displayed according to phase within the buffer~, normalized so that the 0 refers to the first sample, and 1 refers to the last. This type of measurement unit is especially relevant when working with objects that use 0-1 signal sync, such as phasor~ and wave~. - Specifies beats per minute as the time reference unit, relative to a master tempo and number of beats per bar, both of which you can set with the message. waveform~ can also calculate a tempo that fits your current selection, via the message. |
, followed by a symbol argument, sets the unit of time measurement used by the display. Valid symbol arguments are , , , and .
Name | Type | g/s | Description |
---|---|---|---|
attr_bpm | float def.:120. |
Specifies beats per minute as the time reference unit relative to a master tempo and number of beats per bar, both of which you can set with the waveform~ can also calculate a tempo that fits your current selection, via the message. | message.|
beats | int def.:4 |
Toggles the display of time in beat units if the | object is set to display time in bpm units (set using the attribute). The default is 0 (off).|
bgcolor | float | Sets the background color in RGBA format used to paint the entire object rectangle before the rest of the display components are drawn on top. | |
bordercolor | float | Sets the frame color used to draw the single-pixel frame around the object rectangle and the label area in RGBA format. | |
buffername | symbol | Sets the name of the buffer~ object. | |
chanoffset | int def.:1 |
Specifies a given channel in a multi-channel audio file to be displayed. Channel numbering starts at 1, and values must be in the range 1-4. | |
clipdraw | int def.:0 |
When set to 1, will cause values being edited in draw mode to be clipped to the range of the display (as determined by the | message). disables clipping, allowing values to be scaled freely beyond the range of the window. The default is 0, no clipping.|
grid | float def.:1000. |
Specifies that the selection start and end points should snap to the vertical grid lines, as set by the | message. Since the spacing of the grid lines is affected by the current time measurement unit, and by the offset value (if an offset has been specified), snap to grid will be affected by these parameters as well.|
invert | int def.:0 |
Toggles inverting the colors used for selected and non-selected portions of the | object's display. The default is 0 (non-inverted).|
labelbgcolor | float | Sets the label background color in RGBA format. | |
labels | int def.:1 |
Toggles the display of the numerical labels of time measurement across the top of the display. Any non-zero int causes the labels to be drawn. An argument of | , or no argument, disables them.|
labeltextcolor | float | Sets the label text color in RGBA format. | |
norulerclick | int def.:0 |
Toggles clicking and dragging in the ruler area of the waveform~ display. The default is enabled. | |
offset | float def.:0. |
Causes all labels and time measurement markings to be shifted by a specified number of milliseconds. Snap behavior is shifted as well. | can be removed by sending the message , or the message with no argument.|
outmode | int def.:4 |
Determines when selection start and end values are sent in response to mouse activity. Only the selection start and end (outlets 3 and 4) are affected. Mouse information is always sent from outlet 5, regardless of the selected mode. 0 : Selection start and end values are not sent in response to mouse activity. Sending the message with no argument has the same effect as the same message with the argument . 1 : Causes the current selection start and end values to be sent (from outlets 3 and 4) only when you click inside the waveform~ object's display. 2 : Causes selection start and end to be sent only when you release the mouse button, after clicking inside the waveform~ object's display.. 3 : Causes selection start and end to be sent both when you click inside the waveform~ object's display., and when the mouse button is released. 4 : Causes selection start and end to be sent on click, release, and throughout the drag operation, whenever the values change. |
|
quiet | int def.:0 |
Toggles outputting values from the | object while dragging. The default is 0 (send values while dragging) inverting the colors used for selected and non-selected portions of the object's display. The default is 0 (output data while dragging).|
selectalpha | float def.:0.5 |
This attribute is used to import older patches that contain waveform~ objects. Previously, the selection rectangle is painted using two legacy messages (rgb2 and rgb7) and a "blend" transfer mode. Max 5 uses the alpha channel to set the selection color, and will automatically apply this attribute to older version patches containing this object. rectangle. | |
selectioncolor | float | Sets the selection rectangle color which identifies the selection range in RGBA format. | |
setmode | int def.:0 |
Determines how the waveform~ object responds to mouse activity. 0. : Causes waveform~ to enter a "display only" mode, in which clicking and dragging have no effect. For convenience, and to add custom interface behavior, mouse activity is still sent according to the mouseoutput mode. A message with no argument has the same effect as . 1. : Sets the default display mode of the waveform~ object. In select mode, the cursor appears as an I-beam within the waveform~ display area. You can click and drag with the mouse to select a range of values. Mouse activity will cause waveform~ to generate update messages, according to the mouseoutput setting. 2. : Sets an alternative loop selection style that uses vertical mouse movement to grow and shrink the selection length, while horizontal movement is mapped to position. This works well to control a groove~ object. When loop mode is selected, moving your cursor inside the display area changes its appearance to a double I-beam. 3. : Sets the move display mode of the waveform~ object. This mode allows you to navigate the waveform~ view. Vertical mouse movement lets you zoom in and out, while horizontal movement scrolls through the time range of the x-axis. Clicking on a point in the graph makes it the center reference point for the rest of the mouse event (until the mouse button is released). This lets you "grab" a spot and zoom in on it without having to constantly re-center the display. 4. : Sets the draw display mode of the waveform~ object. This mode allows you to edit the values of the target buffer~, using a pencil tool. Clicking and dragging in draw mode directly changes the buffer~ samples, and can not be undone. Sample values are interpolated linearly as you drag, resulting in a continuous change, even if you are zoomed out too far to see the individual samples. |
|
setunit | int def.:0 |
Sets the unit of time measurement used by the display. 0 : Sets the display unit to milliseconds (the default). 1 : Causes time values to be shown as sample positions in the target buffer~. The first sample is numbered 0, unless the display has been shifted by the message. 2 : Causes time to be displayed according to phase within the buffer~, normalized so that the 0 refers to the first sample, and 1 refers to the last. This type of measurement unit is especially relevant when working with objects that use 0-1 signal sync, such as phasor~ and wave~. 3 : Specifies beats per minute as the time reference unit, relative to a master tempo and number of beats per bar, both of which you can set with the message. waveform~ can also calculate a tempo that fits your current selection, via the message. |
|
snapto | int def.:0 |
Sets the snap mode of the waveform~ selection range. causes the start and end points of the selection to automatically move to specific points in the buffer~, defined by the snap mode. 0. : Disables snap to allow free selection (the default). Sending the waveform~ object the message with no argument has the same effect. 1. : Specifies that the selection start and end points should snap to the vertical grid lines, as set by the attribute. Since the spacing of the grid lines is affected by the current time measurement unit, and by the offset value (if an offset has been specified), snap to grid will be affected by these parameters as well. 2. : Causes the selection start and end to snap to the tick divisions specified by the attribute. 3. : Instead of snapping the selection to a uniform grid, this mode searches for zero-crossings of the buffer~ data. These are defined as the points where a positive sample follows a negative sample, or vice-versa. This can be useful to find loop and edit points. |
|
tickmarkcolor | float | Sets the frame color used to draw the tickmarks and measurement lines (if enabled). | |
ticks | int def.:0 |
Specifies the number of ticks that should be drawn between each grid line. The default is eight. An argument of | , or no argument, disables the tick marks.|
vlabels | int def.:0 |
Toggles the drawing of vertical axis labels along the rightmost edge of the waveform~ display. Any non-zero number causes the labels to be drawn. An argument of , or no argument, disables them. | |
voffset | float def.:0. |
Sets the vertical offset of the waveform~ display. A value of 0. places the x-axis in the middle, which is the default. | |
vticks | int def.:1 |
Disables or enables display of the vertical axis tick marks along the left and right edges of the waveform~ display. Any non-zero int causes the tick marks to be drawn. An argument of , or no argument, disables them. | |
vzoom | float def.:1. |
Sets the vertical scaling of the waveform~ display. | |
waveformcolor | float | Sets the foreground color in RGBA format used to draw the buffer~ data as a waveform graph. | |
zoom_orientation | int def.:0 |
Change the zoom orientation depending on mouse direction. |