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

spectroscope~ Reference

Signal spectrogram or sonogram

spectroscope~

Description

spectroscope~ serves as a visual spectrogram or sonogram interface for the analysis of signals.

Examples

Display a sonogram in living color

Arguments

None.

Attributes

bgcolor [4 floats]

Sets the background color of the spectroscope~ object in RGBA format.

displaychan [int] (default: 1)

When displaying a multi-channel signal, define which channel will be displayed.

domain [2 floats] (default: 0. 22050.)

Sets the low and high domain (frequency) values.

fgcolor [4 floats]

Sets the Spectrogram Foreground Color of the spectroscope~ object in RGBA format. The fgcolor attribute is mapped to the color style color.

interval [int] (default: 20)

Sets the polling interval, in milliseconds.

logamp [int] (default: 1)

Toggles between linear (0) and logarithmic (1) amplitude display. By default it is set to logarithmic display. Possible values:

0 = 'Linear Scale'
1 = 'Logarithmic Scale'

logfreq [int] (default: 0)

Toggles log frequency display. By default it is off, but when turned on, the spectrogram or sonogram's frequencies are shown on a logarithmic scale. Possible values:

0 = 'Linear Scale'
1 = 'Logarithmic Scale'

markercolor [4 floats]

Sets the marker color of the spectroscope~ object in RGBA format. The markercolor attribute is mapped to the elementcolor style color.

monochrome [int] (default: 1)

Toggles monochrome display of the sonogram. When turned off, the sonogram display uses a series of five colors. Possible values:

0 = 'Color' ( Two-color sonogram display )
Sets a two-color sonogram display. This the default setting.

1 = 'Monochrome' ( Monochrome sonogram display )
Sets a monochrome sonogram display.

orientation [int] (default: 0)

Sets the vertical or horizontal orientation of the spectroscope~ object. By default it is horizontal, which means frequencies are displayed along the horizontal axis and amplitudes are displayed along the vertical axis in spectrogram mode, and time is displayed along the horizontal axis and frequency is displayed along the vertical axis in sonogram mode. In vertical mode the axes are reversed. Possible values:

0 = 'Horizontal' ( Horizontal display )
Sets the horizontal display mode for sonogram and spectrogram displays. This is the default mode. In sonogram mode, frequencies are displayed along the horizontal axis and amplitudes are displayed along the vertical axis. In spectrogram mode, time is displayed along the horizontal axis and frequency is displayed along the vertical axis.

1 = 'Vertical' ( Vertical display )
Sets the vertical display mode for sonogram and spectrogram displays. In sonogram mode, frequencies are displayed along the vertical axis and amplitudes are displayed along the horizontal axis. In spectrogram mode, time is displayed along the vertical axis and frequency is displayed along the horizontal axis.

phasespect [int] (default: 0)

Toggles the Amplitude/Phase spectrum display. Possible values:

0 = 'Amplitude'
1 = 'Phase'

range [2 floats] (default: 0. 1.2)

Sets the minimum and maximum displayed amplitudes of the spectrum. The default values are 0 and 1.2, for the minimum and maximum, respectively. If the word range is followed by only one number, then it is used as the maximum value, and the minimum range is set to zero.

scroll [int] (default: 0)

Sets the sonogram scrolling mode. By default the sonogram scrolling mode is set to Forward Draw.
Possible values:

0 = 'Forward Draw'
1 = 'Reverse Draw'
2 = 'Forward Scroll'
3 = 'Reverse Scroll'

sono [int] (default: 0)

Toggles sonogram mode. By default the sonogram display is off (meaning it displays a spectrogram, instead). N.B.: Although the terms "spectrogram" and "sonogram" are generally used interchangably to refer to a graph of the spectrum over time, we are using "spectrogram" in its literal sense - to refer to the drawing of a spectrum as an amplitude/frequency representation. Possible values:

0 = 'Spectrogram'
1 = 'Sonogram'

sonohicolor [4 floats]

Sets the color in RGBA format used by the spectroscope~ for displaying frequencies in the high audio range when the object is in color sonogram mode.

sonolocolor [4 floats]

Sets the color in RGBA format used by the spectroscope~ for displaying frequencies in the low audio range when the object is in color sonogram mode.

sonomedcolor [4 floats]

Sets the color in RGBA format used by the spectroscope~ for displaying frequencies in the medium audio range when the object is in color sonogram mode.

sonomedhicolor [4 floats]

Sets the color in RGBA format used by the spectroscope~ for displaying frequencies in the medium high audio range when the object is in color sonogram mode.

sonomedlocolor [4 floats]

Sets the color in RGBA format used by the spectroscope~ for displaying frequencies in the low medium audio range when the object is in color sonogram mode.

sonomonobgcolor [4 floats]

Sets the background color of the spectroscope~ display in RGBA format when the object is displaying sonograms in monochrome mode.

sonomonofgcolor [4 floats]

Sets the foreground color of the spectroscope~ display in RGBA format when the object is displaying sonograms in monochrome mode.

style [symbol] (default: )7.0.0

Sets the style to be applied to the object. Styles can be set using the Format palette.

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.

jspainterfile [symbol]

JS Painter File

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

(mouse)

In "spectrogram" mode, output the coordinates of the mouse within the objects' boundaries. The Y-axis will be provided in a linear range of 0.0 to 1.0. The X-axis will be providsed as the frequency of that location in Hertz. If the mouse has exited the object's bounds the pair of values -1, -1 will be returned. In other modes, the mouse does nothing.

signal

In left inlet: The input signal is analyzed and its spectrum is displayed. If the object is placed inside a pfft~ object's subpatcher, the left inlet is used for the real signal coming from the left outlet of a fftin~ object.

In right inlet: If the object is placed inside a pfft~ object's subpatcher, the right inlet is used for the imaginary signal coming from the second outlet of a fftin~ object. When not inside a pfft~ subpatcher, this inlet does nothing.

Output

Visual

The frequency/amplitude content of the signal is displayed.

See Also

Name Description
meter~ Visual peak level indicator
scope~ Visualize an audio signal