Sound: Draw where...

A command to draw only those parts of a Sound where a condition holds.

Settings

Time range (s)
selects the time domain for the drawing.
Vertical range
defines the vertical limits; larger amplitudes will be clipped.
Draw only those parts where the following condition holds
determines the part of the sound that will be drawn. All parts where the formula evaluates to true will be drawn. This formula may not contain references to the sampling of the sound, i.e. don't use 'col', 'x1', 'dx' and 'ncol' in it.

Example 1

The following script draws all amplitudes larger than one in red.

Create Sound from formula... s Mono 0 1 2000 1.8*sin(2*pi*5*x)+randomGauss(0,0.1)
Red
Draw where... 0 0 -2 2 n Curve abs(self)>1
Black
Draw where... 0 0 -2 2 y Curve not (abs(self)>1)

Example 2

Draw the second half of a sound:

Draw where... 0 0 -1 1 n Curve x > xmin + (xmax - xmin) / 2

Example 3

Draw only positive amplitudes:

Draw where... 0 0 -1 1 n Curve self>0

Example 4

Draw parts where pitch is larger than 300 Hz in red:

s = selected ("Sound")
p = To Pitch... 0 75 600
pt = Down to PitchTier
select s
Red
Draw where... 0 0 -1 1 yes Curve Object_'pt'(x) > 300
Black
Draw where... 0 0 -1 1 yes Curve not (Object_'pt'(x) > 300)

Links to this page


© djmw, February 13, 2011