Period:
Filter:
SPList (extension) | SPList

Period
ExtensionExtension

Period represents one waveset

Description

Period provides a reference to a section of a SPLSourceFile. It provides an interface to perform Transformations on this.

Class Methods

.newSine

It is possible to create Periods with a sine as waveset. this is a special case, normaly Periods get created by SPLSourceFile.

Arguments:

size

The pitch or length of the waveset.

aamp

The volume of the waveset.

posi

A number for the position of the waveset.

ot

Overton, a multiplication factor for the pitch of the waveset.

par

The parent SPList of this Period.

Returns:

a Period

Instance Methods

.amp

Maximal Amplitude of a Period.

.rms

RMS of a Period.

.peaks

Number of local min and maxima.

.delta

Sum of the difference between samples / size.

.sec

Duration of a Period in seconds.

.freq

Duration of a Period in Hz.

.size

Duration of a Period in samples.

.length

Duration of a Period in samples. equivalent to size in samples

.plot

writes this period to a Buffer and plots it. the arguments are the same as Buffer.plot.

Transformation methods

delete

removes a period from its parent.

transposeToFreq

sets the length of a period to a specific time in Hz.

Arguments:

newfreq

new length in Hz

Returns:

(describe returnvalue here)

transposeToSize

sets the length of a period to a specific time in samples.

Arguments:

newsize

new length in samples

transposeToSec

sets the length of a period to a specific time in seconds.

Arguments:

newSec

new length in seconds

env

Applies a SPEnv Envelope on a SPList. a envelope applied on a Period is a special case of amplitude modulation.

Arguments:

envelope

Needs a SPEnv object.

loop

(describe method here)

Arguments:

n

(describe argument here)

Returns:

(describe returnvalue here)

pos

Position in the original sound file.

merge

merges two periods like a mix pitchshifted so that the period lenght is merged.

Arguments:

aPeriod
pan

volume factor for the added period.

sizeBlend

0 length/freq of the original period 1 length/freq of the added period

parent

Reference to parent SPList

transpose

Mulitiplication of the lenth of a Period.

Returns:

(describe returnvalue here)

gain

Mulitiplication of the amplitude of a Period.

Returns:

(describe returnvalue here)

reset

removes all transformations applied on a Period

addSine

add a sine to a existing Period.

Arguments:

ot

Overtone.

sinamp

volume of the sine.

inamp

volume of the original Period.

Complex methods

No time right now to document.

addEffect

(describe method here)

Arguments:

name

(describe argument here)

... args

(describe argument here)

Returns:

(describe returnvalue here)

transposeCurve

(describe method here)

Arguments:

p1

(describe argument here)

p2

(describe argument here)

p3

(describe argument here)

Returns:

(describe returnvalue here)