Softanza
StartFrançais
Softanza
The library documents itself · Sound

stzSound

40 own methods · 10 forms written with extensions, listed under their method

the source: base/sound/stzSound.ring(opens in a new tab) · All classes · The area reference: Sound

Under each method, its extensions (Q CS XT Z ZZ IB W U): bold and ticked, it exists; struck, it does not. The extensions and what they mean

No method of this class is run on this page: the class reaches files, the network, processes, the clock, chance or sound, and an example run here would only be an example of its effects. Each method carries the explanation the library gives of itself.

Method
Explanation, as the source carries it
init
(no comment in the source: the name reads as a sentence) initno extension
MakeSilence
lifecycleQCSXTZZZIBWU
AdoptBuffer
(no comment in the source: the name reads as a sentence) adopt bufferno extension
BufferId
Hand the engine id out -- for a graph that wants this sound as a source. An ENGINE handle, not a pointer, so it obeys the house law.no extension
Release
(no comment in the source: the name reads as a sentence) releaseno extension
IsEmpty
(no comment in the source: the name reads as a sentence) is emptyno extension
LastError
(no comment in the source: the name reads as a sentence) last errorno extension
Frames
readers: they return DATA and keep their namesno extension
Channels
(no comment in the source: the name reads as a sentence) channelsno extension
SampleRate
(no comment in the source: the name reads as a sentence) sample rateno extension
Duration
(no comment in the source: the name reads as a sentence) durationno extension
Peak
(no comment in the source: the name reads as a sentence) peakno extension
Rms
(no comment in the source: the name reads as a sentence) rmsno extension
SampleAt
ONE sample. 1-based frame and channel, like every Haro face.no extension
SetSampleAt
(no comment in the source: the name reads as a sentence) set sample atQCSXTZZZIBWU
ToList
The samples of one channel, as a Haro list. DATA, so To... is right. Be aware this crosses the FFI once per sample -- fine for a look at a few thousand frames, wrong for a whole song.no extension
ResampleTo
verbs that change the sound ---------------------------------------- Resample to a new rate. QUALITY is sinc unless you ask otherwise -- SN1 measured sinc at 97x the accuracy of linear for 26x the cost, and still 150x faster than real time, so it is the right default.QCSXTZZZIBWU
ResampleToFast
(no comment in the source: the name reads as a sentence) resample to fastQCSXTZZZIBWU
ChangeChannelsTo
(no comment in the source: the name reads as a sentence) change channels toQCSXTZZZIBWU
ToMono
(no comment in the source: the name reads as a sentence) to monoQCSXTZZZIBWU
ToStereo
(no comment in the source: the name reads as a sentence) to stereoQCSXTZZZIBWU
ToWavBytes
The symmetric half of loading from memory, and its absence was a real gap: a sound could be decoded FROM bytes but not encoded back TO them, so handing a buffer to another tier meant a temporary file. VC1 went to some trouble to keep a voice out of the filesystem; without this, VC3 would have put it straight back to feed a recogniser.no extension
MixIn
16-bit by default: it is what everything reads, and SN1 measured the round-trip error at 4.18e-5, one quantum. Ask for 32 when you are handing the file back to another stage rather than to a listener. ADD another sound into this one from pnSeconds in, scaled by pnGain -- notes laid on a timeline. Refused when the sample rates differ: a note mixed at the wrong rate would be a different pitch, silently.no extension
SaveAs
(no comment in the source: the name reads as a sentence) save asQCSXTZZZIBWU
SaveAsFloat
(no comment in the source: the name reads as a sentence) save as floatQCSXTZZZIBWU
Play
hearing it ---------------------------------------------------------- PLAY IT, and wait for it to finish. There is no sample-player in the engine -- the device sink plays a STREAM -- so the face builds the smallest graph that can carry this sound and runs it. That is what a declarative face is for: the caller says "play", not "make a graph, start a producer thread, open a device, wait, then take it all down".no extension
PlayFor
(no comment in the source: the name reads as a sentence) play forQCSXTZZZIBWU
ToSpectrum
To...() because these RETURN things. A spectrum is a stzSoundGrid: rows by columns of numbers, with x_step and y_step saying what a row and a column MEAN. Drawing one is the graphics plane's job, and keeping that boundary is what makes the analysis assertable -- "the 1 kHz sine is in the 1 kHz bin" is a claim about numbers; "the picture looks right" is a claim about nothing. The magnitude spectrum of one window. Default 4096 points: about 12 Hz resolution at 48 kHz, which resolves musical pitch without smearing time.no extension
ToSpectrumOf
(no comment in the source: the name reads as a sentence) to spectrum ofno extension
ToSpectrogram
Frequency against time: one row per window. MULTICORE by default -- every row is an independent FFT over a different slice of the same immutable buffer, which is the one analysis here that parallelises without an argument.no extension
ToSpectrogramOf
(no comment in the source: the name reads as a sentence) to spectrogram ofno extension
DominantFrequency
The strongest frequency present, in hertz.no extension
ToOnsets
Where notes START, in seconds -- a one-row grid of times.no extension
ToOnsetsOf
(no comment in the source: the name reads as a sentence) to onsets ofno extension
Tempo
Beats per minute, or -1 when there are too few onsets to say -- which is a better answer than a confident number derived from two events.no extension
Loudness
The standard's K-weighting coefficients are specified at 48 kHz, and the engine REFUSES any other rate rather than applying them anyway. So the face resamples a COPY when it has to -- the caller's sound is not touched, and nobody gets a plausible-looking wrong number.no extension
MomentaryLoudness
MomentaryLoudness is the standard's own 400 ms window, ungated, taking the LOUDEST such window rather than a mean -- averaging an earcon against the silence around it answers nothing. BS.1770 arithmetic used as specified, so it is LUFS without qualification.no extension
ShortTermLoudness
(no comment in the source: the name reads as a sentence) short term loudnessno extension
LoudnessOfSupport
The same K-weighting and the same formula over the sound's OWN length. NOT a standard LUFS figure, and LoudnessMetric() says so -- because the alternative is answering the standard's question wrongly instead of answering a different question honestly. A 60 ms earcon at peak 0.5 reads -9.26 here against -9.27 for the same tone at 400 ms: the two agree to a hundredth of a decibel where the standard has an opinion, which is what makes this trustworthy where it does not.no extension
LoudnessMetric
What the number means, so it never travels without its method.no extension