Sound.freq

From MiniScript Wiki
Revision as of 21:55, 27 April 2020 by SpatialPlays (talk | contribs) (Created Sound.freq, including working examples and references to relevant functions)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Sound.freq controls how many times a second a waveform is repeated.

For example, a middle C on a piano produces a sound frequency of 261.626 times a second:

snd = new Sound
snd.init(2)
snd.freq = 261.626
snd.play

It can be assigned a single frequency, or a list of frequencies, and Micro Mini will interpolate between frequencies over the duration of the sound:

snd = new Sound
snd.init(2)
snd.freq = [noteFreq(58), noteFreq(43)]
snd.play

See also: Sound.init; noteFreq