Loscil is framed

i’m looking into creating a few new samples for the manual, and i want to create a few containing loop points. These looppoints are save din the header of a wav.

I have successfully created loop points in the fox, and using loscil3 this works:
am loscil3 1, 1, 1, 1, -1
the -1 tells loscil3 to use the embedded loop points in the fox.

for ibeg1, iend1, ibeg2, iend2 i read: " These are measured in sample frames from the beginning of the file, so will look the same whether the sound segment is monaural or stereo."

So, finally my question: what are sample frames?

possibly 44.100 / ksmps ?

a sample frame is the time measured in samples. so if you have sr=48000
and you want to skip 1 second, you have to go to sample frame 48000.
for mono files it is the same as the number of samples, but for stereo
files the number of samples would be 96000, wheras the sample frame is
still 48000.

mmm…and what about:" so will look the same whether the sound segment is monaural or stereo"?

i was confused by the words sample frame, but i think it is, just as you said, sample value.
i made the fox stereo interleaved and the looping starts and returns at the same spot: sample values- mono or stereo…

instr 1

ichnls = ftchnls(p4)
print ichnls

if (ichnls == 1) then
asigL loscil3 1, 1, 1, 1, 1, 48000, 80000
asigR = asigL
elseif (ichnls == 2) then
asigL, asigR loscil3 1, 1, 2, 1, 1, 48000, 80000
;safety precaution if not mono or stereo
asigL = 0
asigR = 0
outs asigL, asigR


f 1 0 0 1 “fox48.wav” 0 0 0
f 2 0 0 1 “fox48stereo.wav” 0 0 0

i 1 0 20 1 ;mono file
i 1 + 20 2 ;stereo file

Screenshot from 2021-04-29 21-41-34

must be that mono or stereo they are both 48000 sample frames per second.

I was reading about sample frames a while in the Web Audio documentation. Here’s what they say: “A frame, or sample frame, is the set of all values for all channels that will play at a specific point in time: all the samples of all the channels that play at the same time (two for a stereo sound, six for 5.1, etc.)” So the idea of sample frames is related to the number of channels in your piece. If your sampling rate is 48000, then you’ll have 48000 sample frames per second. But in each of those frames you have to calculate a sample for each channel. So if you have a quadraphonic piece then each sample frame will hold four samples.


That is exactly what i found out in the mono versus stereo fox of 48kHz; they do their loop at the same time spot, in my example both at 48000, end point 80000.
The time spot would be the same if the sample was quadraphonic or otherwise, as i understand now.

Thanks, Jason, very helpful. This is something to add in the manual for sure.

I found this in What is a frame? — Audiobus Forum
" A frame is simply a set of samples with the same timestamp, one for each channel. E.g. if your audio is mono, 1 frame is 1 sample. If your audio is stereo, 1 frame is 2 samples (left + right). When we say 44100 kHz we mean 44100 samples per channel per second, i.e. 44100 frames per second."