Csound Csound-dev Csound-tekno Search About

Re: Help Needed: loscil

Date2006-05-29 18:16
From"Art Hunkins"
SubjectRe: Help Needed: loscil
Thanks, Istvan, for both of these updates. They take care of all my
immediate needs. (It also would be wonderful if someone could update and
clarify the documentation for loscil, loscil3 and nsamp. I'd be happy to
review any updates if that would help.)

I'd noted, upon further study of the docs for ftlen and nsamp, that clearly
ftlen had been updated to work with deferred-size ftables, whereas nsamp
apparently had not. So, following your fix, nsamp is updated as well. Good.

I've been trying further to investigate whether loscil works correctly with
samples that contain their own looping information. Either 1) it is not
working; or 2) the distribution doesn't contain any such samples, so you
can't know whether the feature works or not.

Either of the following should loop a sample that contains its own loop
data:
a1  loscil 10000, 1, 1, 1
a1  loscil 10000, 1, 1, 1, -1

All the samples in the distribution, including mary.wav, beats.aiff and
kickroll.wav, simply play once and stop. So either they contain no looping
information or else loscil is ignoring it - even when ftable size is not
deferred. (This is fine with me, but is not what the docs indicate.)

You would especially expect beats.aiff to contain looping info, as it is
used as an example of this feature in the documentation for loscil.

I'd really like to be certain loscil is not working correctly with samples
than include their own looping info. Does anyone know of a sample in the
distribution that includes looping information?

Or could someone send me such a sample so I can test it with loscil?
(Perhaps, OTOH, someone has already tested this and can report whether this
feature works with the above loscil code or not.)

TIA, and thanks again, Istvan.

Art Hunkins

----- Original Message ----- 
From: "Istvan Varga" 
To: 
Sent: Monday, May 29, 2006 10:00 AM
Subject: Re: [Csnd] Help Needed: loscil


> On Monday 29 May 2006 00:18, Art Hunkins wrote:
>
> > 1) Get nsamp to work with deferred-size ftables;
>
> Done. nsamp() now returns the number of sample frames in a table loaded
> with GEN01. Note that it differs from ftlen(), for example with a stereo
> sound file of 10000 samples, ftlen() would return 19999 (i.e. a total of
> 20000 mono samples, not including a guard point), but nsamp() returns
> 10000. Also, currently nsamp() will return 0 if the table was not loaded
> with GEN01; it is not clear from the documentation how the function
> should behave in this case, so I kept what seemed to be the intended
> behavior of the code.
>
> > 2) When looping is requested in loscil (and loscil3), and no looping
data is
> > specified in the opcode, default the sustain loop to the length of the
> > entire sample. Example (that works the same as the above code):
> > a1, a2  loscil 10000, 1, 1, 1, 1
>
> This is also implemented now.
> -- 
> Send bugs reports to this list.
> To unsubscribe, send email to csound-unsubscribe@lists.bath.ac.uk

Date2006-05-30 16:59
FromPrent Rodgers
SubjectRe: Help Needed: loscil
AttachmentsHorn.ff.F5.aif  
Attached is a French Horn sample containing looping data. If someone is 
looking at loscil, it would be nice if the pitch correction information 
buried in the .aiff was used, or documented that it is ignored. This is 
not very important, though.

Here's what sndinfo says about the French Horn sample. I don't know why 
it says "no looping", even though the next line says "looping with modes 
1,0". Curious.

Horn.ff.D#5.aif: AIFF, 98685  samples, no looping
         AIFF soundfile, looping with modes 1, 0
         srate 44100, monaural, 16 bit shorts, 2.24 seconds
         headersiz 54, datasiz 197370 (98685 sample frames)

I've been using loscil for the past 8 years and have worked around all 
the issues I encountered. I now have a test in my orchestra to check, 
through a table lookup, if a sample is looping or not, and invoke a 
different form of loscil based on the answer. I also look up if it is a 
mono or stereo sample. Another table applies pitch correction, for each 
sample. At one point I applied a time correction to accommodate sound 
startup delays, via a table of values.

Prent Rodgers


Art Hunkins wrote:
> I'd really like to be certain loscil is not working correctly with samples
> than include their own looping info. Does anyone know of a sample in the
> distribution that includes looping information?
> 
> Or could someone send me such a sample so I can test it with loscil?
> (Perhaps, OTOH, someone has already tested this and can report whether this
> feature works with the above loscil code or not.)
> 
> TIA, and thanks again, Istvan.
> 
> Art Hunkins
> 
> ----- Original Message ----- 

-- 
Music that's "Fake but Accurate"!
Web page: http://prodgers13.home.comcast.net
Podcast: http://podcast1024.libsyn.com
Another Podcast: http://BumperMusic.blogspot.com
Music: http://www.soundclick.com/PrentRodgers

Date2006-05-30 17:24
FromAndres Cabrera
SubjectRe: Help Needed: loscil
Hi,
> Here's what sndinfo says about the French Horn sample. I don't know why 
> it says "no looping", even though the next line says "looping with modes 
> 1,0". Curious.
> 
> Horn.ff.D#5.aif: AIFF, 98685  samples, no looping
>          AIFF soundfile, looping with modes 1, 0
>          srate 44100, monaural, 16 bit shorts, 2.24 seconds
>          headersiz 54, datasiz 197370 (98685 sample frames)
> 
> I've been using loscil for the past 8 years and have worked around all 
> the issues I encountered. I now have a test in my orchestra to check, 
> through a table lookup, if a sample is looping or not, and invoke a 
> different form of loscil based on the answer. I also look up if it is a 
> mono or stereo sample. Another table applies pitch correction, for each 
> sample. At one point I applied a time correction to accommodate sound 
> startup delays, via a table of values.

This again seems to point to the fact that libsndfile has only recently
implemented looping points. This should be corrected if the 5.02
installers are built using the latest libsndfile.

Cheers,
Andrés