[Csnd] loscil loop points

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[Csnd] loscil loop points

fauveboy
To set loop points I understand loscil takes the audio frame as an arg ( which im currently doing manually). is there a friendlier way to set loop points by having csound do the math?

Csound mailing list
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] loscil loop points

hlolli
There's basic math you can't avoid, you can imagine math where 1 = 100% and you could segment the sample.
ilen ftlen iTable
isr ftsr iTable

just use the ilen as the whole sample and chop it up with division.

Recommend setting p3 correctly, annoying when loscil wraps/loops unwantingly (for freq = 1 then p3 = ilen/isr should work for one iteration over the sample)
If you want to loop the last 25% of the sample thousand times, then just remember to multiply by 1000 in that p3 I wrote above.


On 30 January 2018 at 00:54, Joel Ramsbottom <[hidden email]> wrote:
To set loop points I understand loscil takes the audio frame as an arg ( which im currently doing manually). is there a friendlier way to set loop points by having csound do the math?

Csound mailing list
[hidden email]
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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] loscil loop points

fauveboy
In reply to this post by fauveboy
I'm not getting sound yet. What kind of input is used for p3 in the score statement any?
My code looks somewhat like the following is this correct?

orc
                        instr 106
a1, a2 loscil  10000, 1, 5, 1, 1  ;sample-based looping oscillator
ilen = ftlen 5
isr = ftsr(5)
p3 = ilen/isr
                out a1, a2
                endin
sco
i100 0 ?

Csound mailing list
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] loscil loop points

hlolli
The idea I had in mind with p3 is that you may want to send score events and play a sample only once, like pressing a key on a keyboard. But if you're looking to do an instrument that's running indefinetely, then you shouldn't put p3 there in the orchestra(your instrument). p3 = x is just replaceing the value of the p3 the score event was sending, I use it a lot when playing sample banks where the 1 sample is 0.5 sec mixed with 3 sec samples, and beforehand I don't know for how long the instrument needs to be running for the whole sample to get played troug, therefore I set the p3.

How are you going to trigger the instrument from pd, you want a button to play a sample once, or do you want maybe some sliders to modify k-rate values and loop the sample while the instrument is running indefinitely?

On 30 January 2018 at 11:40, Joel Ramsbottom <[hidden email]> wrote:
I'm not getting sound yet. What kind of input is used for p3 in the score statement any?
My code looks somewhat like the following is this correct?

orc
                        instr   106
a1, a2 loscil  10000, 1, 5, 1, 1  ;sample-based looping oscillator
ilen = ftlen 5
isr = ftsr(5)
p3 = ilen/isr
                out     a1, a2
                endin
sco
i100 0 ?

Csound mailing list
[hidden email]
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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] loscil loop points

fauveboy
In reply to this post by fauveboy
I 'm aiming for the sample to loop indefinitely using a toggle button and to send k rate values to adjust the loop points from pd?

are you saying you use p3 when you're launching a sample once? but does that mean you have to predetermine the length before is launched?

Csound mailing list
[hidden email]
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