[Contents] · [Home] · [Mail]

SALIERI Language - getPitch

Type:
getPitch: sequence x integer -> integer x integer x integer
getPitch: sequence -> integer x integer x integer

Call syntax:
getPitch(seq, i)
getPitch(seq)

Description:
getPitch returns a list containing pitch-class, octave, and alteration of the note at index position i of sequence seq. If no index position is specified, i = 1 is assumed.

The first element of the result list is the pitch-class of the resp. note (0 for c, 1 for cis, ..., -1 for rest); accidentals, if present for that note, are taken accounted for when calculating the pitch-class such that enharmonic tones yield the same pitch-class information (see examples).

The second element of the result list is the octave of the note (0 for rests), the third element the alteration (0 for no accidentals, +1 for one sharp, -1 for one flat, ...).

Index positions are counted starting with 1.

Error conditions:
If i is not a valid index position, i.e., i < 1 or i > length(seq), (-1,0,0) is returned.

Example:
> getPitch([c1/4 c#],2)
Result= LIST(1,1,1)
> getPitch([f1/4])
Result= LIST(5,1,0)
> getPitch([f#2/4])
Result= LIST(6,2,1)
> getPitch([e##2/4])
Result= LIST(6,2,2)
> getPitch([g&2/4])
Result= LIST(6,2,-1)
> getPitch([h#0/4])
Result= LIST(0,1,1)
> getPitch([c&&-1/4])
Result= LIST(10,-2,-2)
> getPitch([_])
Result= LIST(-1,0,0)
> getPitch([c1/4 g/2],3)
Result= LIST(-1,0,0)

See also: isRest, length.


[Contents] · [Home] · [Mail]
© sic!systems, page frame designed by hh; this page has been automatically generated from the SALIERI Documentation Database.