A newer version of Max is available. Click here to access the latest version of the Max documentation

jit.buffer~

Access an MSP buffer~ in matrix form

Description

Represents audio in a float32 matrix with time across dim[0]. Multi-channel audio uses a separate plane for each channel. The object arguments are the same as those for the buffer~ object. jit.buffer~ responds to all the same messages as buffer~.

Examples

Arguments

buffer_name []

The name of the buffer~ to access

filename []

Optional filename to read

length []

Optional length in milliseconds

channels []

Optional number of channels (default=1)

Attributes

inputfirst [int]

An input matrix will be written to the buffer~ starting at this frame

inputstart [float]

An input matrix will be written to the buffer~ starting at this position in milliseconds

outputfirst [int]

Frame at which to start collecting data from the buffer~ for an output matrix

outputlast [int]

Frame at which to finish collecting data from the buffer~ for an output matrix

outputlength [float]

The length in milliseconds of the output matrix collected from the buffer~

outputstart [float]

The position in milliseconds to start collecting data from the buffer~ for an output matrix

vizchecktime [int]

How often in milliseconds the visualization engine should check the status of the buffer~ and re-render the cache if necessary (default=250)

vizfirst [int]

Frame at which to start render of the visualization output matrix

vizheight [int]

The height of the visualization output matrix (default=160)

vizmode [int]

A value of 1 turns on opaque rendering mode. A value of 2 turns on statistical rendering mode, which has greater detail but is more expensive to render. A value of 0 turns off visualization and all background processing of cached speedup data. (default=0)

vizlast [int]

Frame at which to end render of the visualization output matrix

vizlength [float]

The length in milliseconds to render for the visualization output matrix

vizmemoryratio [float]

Specifies the size of the data cache used to speed up rendering of the visualization matrix as a fraction of the data size of the buffer~ (default=0.5)

vizstart [float]

The position in milliseconds to start the render of the visualization output matrix

vizwidth [int]

The width of the visualization output matrix (default=320)

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] (default: 0)

Adds or removes the object from the patcher's background layer. background 1 adds the object to the background layer, background 0 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'

hidden [int] (default: 0)

Toggles whether an object is hidden when the patcher is locked.

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] (default: 0)

Toggles whether an object ignores mouse clicks in a locked patcher.

patching_rect [4 floats] (default: 0. 0. 100. 0.)

Sets the position and size of the object in the patcher window.

position [2 floats]

g/s(set)

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] (default: 0)

Sets whether an object belongs to the patcher's presentation.

presentation_rect [4 floats] (default: 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]

g/s(set)

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]

g/s(set)

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 [float]

Sets the color for the object's text in RGBA format.

textjustification [int]

Text Justification

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

anything

Any message not specifically handled by the jit.buffer~ object will be passed along to its child buffer~ object.

(mouse)

Double-clicking on a jit.buffer~ object opens a display window where you can view its contents.

getframes

Outputs the number of frames.

getlength

Outputs the length of the buffer~ in milliseconds.

output

float32 matrix containing the range of the buffer~ specified by the outputstart, outputlength, outputfirst and outputlast attributes will be output out the left outlet.

viz

Outputs a visualization matrix from the second outlet. In opaque mode the matrix will be of type char and in statistical mode the matrix will be of type float32. In both modes each channel of audio results is mapped to a separate plane of the matrix.

See Also

Name Description
Working with Video in Jitter Working with Video in Jitter
jit.catch~ Transform signal data into matrices
jit.graph Perform floating-point data visualization
jit.peek~ Read matrix data as an audio signal
jit.poke~ Write an audio signal into a matrix
jit.release~ Transforms matrix data into signals
peek~ Read and write sample values
poke~ Write sample values to a buffer by index
Tutorial 48: Frames of MSP signals Tutorial 48: Frames of MSP signals