[Csnd] loscil3 release loop

Hello, can someone please explain me why the following isn't working?
I am trying to loop a sample and have it continue looping during the
release phase (I have tried other ways also but nothing works for me).

<CsoundSynthesizer>
<CsOptions>
-o dac
</CsOptions>
<CsInstruments>
sr=44100
ksmps=32
nchnls=1
0dbfs=1

instr 1
itie tival
print itie
xtratim 1
kenv linsegr 1, 1, 0
asig loscil3 1, 1, 123, 1, 1, 0, ftlen(123), 1, 0, ftlen(123)
outs kenv * asig
endin

</CsInstruments>
<CsScore>

f 123 0 0 -1 "monosample.wav" 0 0 0

i 1 0 -1
i -1 1 -1

</CsScore>
</CsoundSynthesizer>

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here

You don’t have any release segment?

https://csound.com/docs/manual/linsegr.html

If I use "kenv linsegr 1, 0.01, 1, 1, 0" instead the looping also
stops at the time of the 'note off' event.

Anyway, if you try the following code you can see that "kenv linsegr
1, 1, 0" actually also specifies a release segment (although the
documentation does not specify "ia, idur1, ib " as optional).

<CsoundSynthesizer>
<CsOptions>
-o dac
</CsOptions>
<CsInstruments>
sr=44100
ksmps=32
nchnls=1
0dbfs=1

instr 1
itie tival
print itie
xtratim 1
kenv linsegr 1, 1, 0
asig poscil3 1, 200
outs kenv * asig
endin

</CsInstruments>
<CsScore>
i 1 0 -1
i -1 3 -1
</CsScore>
</CsoundSynthesizer>

Sorry, I didn’t realise that it has default release segments. I’m not sure. I would also expect the loop to continue for the duration of the release segment. If I swap out loscil3 with a phasor/tab combo it works.

instr 1
kenv linsegr 1, 1, 1, 5, 0
;asig loscil3 1, 1, 123, 1, 1, 0, ftlen(123), 1, 0, ftlen(123)
a1 phasor 1
asig tab a1, 123, 1
outs kenv * asig
endin

Nice, but I would really like to use loscil3 (for interpolation and such).
It seems perhaps there is a bug in loscil3?

Seems like a bug to me but I’d like to see what others think before filing an issue on github?

Just a shot in the dark, but perhaps loscil is reading (or trying to read) the release loop points from the sound file, and there might be potential for conflicts/issues related to that?

fre. 15. jan. 2021 kl. 12:55 skrev Rory Walsh <rorywalsh@ear.ie>:

Seems like a bug to me but I’d like to see what others think before filing an issue on github?

Nice, but I would really like to use loscil3 (for interpolation and such).
It seems perhaps there is a bug in loscil3?

Sorry, I didn’t realise that it has default release segments. I’m not sure.
I would also expect the loop to continue for the duration of the release
segment. If I swap out loscil3 with a phasor/tab combo it works.

instr 1
kenv linsegr 1, 1, 1, 5, 0
;asig loscil3 1, 1, 123, 1, 1, 0, ftlen(123), 1, 0, ftlen(123)
a1 phasor 1
asig tab a1, 123, 1
outs kenv * asig
endin

If I use “kenv linsegr 1, 0.01, 1, 1, 0” instead the looping also
stops at the time of the ‘note off’ event.

Anyway, if you try the following code you can see that “kenv linsegr
1, 1, 0” actually also specifies a release segment (although the
documentation does not specify "ia, idur1, ib " as optional).

-o dac sr=44100 ksmps=32 nchnls=1 0dbfs=1

instr 1
itie tival
print itie
xtratim 1
kenv linsegr 1, 1, 0
asig poscil3 1, 200
outs kenv * asig
endin

i 1 0 -1 i -1 3 -1

You don’t have any release segment?

https://csound.com/docs/manual/linsegr.html

Hello, can someone please explain me why the following isn’t working?
I am trying to loop a sample and have it continue looping during the
release phase (I have tried other ways also but nothing works for me).

-o dac sr=44100 ksmps=32 nchnls=1 0dbfs=1

instr 1
itie tival
print itie
xtratim 1
kenv linsegr 1, 1, 0
asig loscil3 1, 1, 123, 1, 1, 0, ftlen(123), 1, 0, ftlen(123)
outs kenv * asig
endin

f 123 0 0 -1 “monosample.wav” 0 0 0

i 1 0 -1
i -1 1 -1

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

The test .wav-file I am using does indeed have loop information. I
just tried deleting this info from the file, but the problem is still
there.

Thanks for testing that. What I (also) meant was that perhaps the opcode is trying (and failing) to read this info, and an issue happens regardless of the info being present in the file or not.
Did you also try to not enter explicit release loop points as arguments to the opcode (as these will probably override the info in the file)?
eI also now noticed the loscil3phs opcode, seemingly a copy of loscil3 with a phase output, Could be something to try, if it misbehaves the same way. And also try lposcil (lposcil3) as an alternative.

But it does seem there is something wrong with loscil release looping, so please also report an issue on github with the example you posted here showing the error.

all best
Øyvind

fre. 15. jan. 2021 kl. 13:58 skrev Søren Jakobsen <sorenkj@gmail.com>:

The test .wav-file I am using does indeed have loop information. I
just tried deleting this info from the file, but the problem is still
there.

Just a shot in the dark, but perhaps loscil is reading (or trying to read)
the release loop points from the sound file, and there might be potential
for conflicts/issues related to that?

fre. 15. jan. 2021 kl. 12:55 skrev Rory Walsh <rorywalsh@ear.ie>:

Seems like a bug to me but I’d like to see what others think before
filing
an issue on github?

Nice, but I would really like to use loscil3 (for interpolation and
such).
It seems perhaps there is a bug in loscil3?

Sorry, I didn’t realise that it has default release segments. I’m not
sure.
I would also expect the loop to continue for the duration of the
release
segment. If I swap out loscil3 with a phasor/tab combo it works.

instr 1
kenv linsegr 1, 1, 1, 5, 0
;asig loscil3 1, 1, 123, 1, 1, 0, ftlen(123), 1, 0, ftlen(123)
a1 phasor 1
asig tab a1, 123, 1
outs kenv * asig
endin

If I use “kenv linsegr 1, 0.01, 1, 1, 0” instead the looping also
stops at the time of the ‘note off’ event.

Anyway, if you try the following code you can see that “kenv linsegr
1, 1, 0” actually also specifies a release segment (although the
documentation does not specify "ia, idur1, ib " as optional).

-o dac sr=44100 ksmps=32 nchnls=1 0dbfs=1

instr 1
itie tival
print itie
xtratim 1
kenv linsegr 1, 1, 0
asig poscil3 1, 200
outs kenv * asig
endin

i 1 0 -1 i -1 3 -1

You don’t have any release segment?

https://csound.com/docs/manual/linsegr.html

Hello, can someone please explain me why the following isn’t
working?

I am trying to loop a sample and have it continue looping during
the
release phase (I have tried other ways also but nothing works for
me).

-o dac sr=44100 ksmps=32 nchnls=1 0dbfs=1

instr 1
itie tival
print itie
xtratim 1
kenv linsegr 1, 1, 0
asig loscil3 1, 1, 123, 1, 1, 0, ftlen(123), 1, 0, ftlen(123)
outs kenv * asig
endin

f 123 0 0 -1 “monosample.wav” 0 0 0

i 1 0 -1
i -1 1 -1

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features
can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Thanks for the tip - lposcil3 works perfectly!
Yes I also tried letting loscil3 read the loops from the file, like
this: "asig loscil3 1, 1, 123, 1, -1, 0, ftlen(123), -1, 0,
ftlen(123)" - makes no difference, though I just noticed that the
sound actually does start to fade out towards the end, but the fadeout
is cut off before it finishes.

Maybe an example, like this one that ‘works perfectly’ might be a good thing to add to the manual - to show how to make it work perfectly? -dB