Csound Csound-dev Csound-tekno Search About

turnoff an instrument

Date2016-03-14 20:47
Fromjpff
Subjectturnoff an instrument
I want/need to have an instrument that at i-time turns off instr 15
and then schedules i15 for a little in the future

turnoff2 works at perf time ad schedule is OK for the second part but
how do I turn off i15 at i-time?  turnoff looks useful but the manual
is unclear (to me).  It looks as if I need to start i15 via nstance?
is that correct?  I would love an example

I have tried
instr 7
  turnoff2 15, 0, 0
  schedule 2, 0.5, $LEN, 1, $LEN
endin

which fails

and
instr 7
  turnoff gi15
  gi15 nstance 15, 0.3, 36000, 1, $LEN
endin
which complains with
new alloc for instr 7:
WARNING: instance not valid 

Any help welcome -- I do not usually work in real time
==John ffitch

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

Date2016-03-14 21:10
FromVictor Lazzarini
SubjectRe: turnoff an instrument
I will have a look tomorrow at my computer, but I would have thought you could use schedule with negative p3 to turn it off and then schedule again to turn it on in the future.

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

> On 14 Mar 2016, at 20:47, jpff  wrote:
> 
> I want/need to have an instrument that at i-time turns off instr 15
> and then schedules i15 for a little in the future
> 
> turnoff2 works at perf time ad schedule is OK for the second part but
> how do I turn off i15 at i-time?  turnoff looks useful but the manual
> is unclear (to me).  It looks as if I need to start i15 via nstance?
> is that correct?  I would love an example
> 
> I have tried
> instr 7
>  turnoff2 15, 0, 0
>  schedule 2, 0.5, $LEN, 1, $LEN
> endin
> 
> which fails
> 
> and
> instr 7
>  turnoff gi15
>  gi15 nstance 15, 0.3, 36000, 1, $LEN
> endin
> which complains with
> new alloc for instr 7:
> WARNING: instance not valid 
> 
> Any help welcome -- I do not usually work in real time
> ==John ffitch
> 
> 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

Date2016-03-14 21:20
FromTarmo Johannes
SubjectRe: turnoff an instrument
Hi!

I think negative p2 works only for instruments started with negative p3.

otherwise

schedule -15,0,0

should work at i-time.

or iif you set ksmps very low you can do turnoff2 on the first k-cycle and 
then quit the instrument:

instr 7
  setkspms 1 ; from memory, not sure if this is correct syntax. maybe you 
don't need it
  turnoff2 15, 0, 0
  schedule 2, 0.5, $LEN, 1, $LEN
  turnoff ; after 1tst k-clcyle - work done 
endin

  

tarmo


On Monday 14 March 2016 21:10:48 you wrote:
> I will have a look tomorrow at my computer, but I would have thought you
> could use schedule with negative p3 to turn it off and then schedule again
> to turn it on in the future.
> 
> Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
> 
> > On 14 Mar 2016, at 20:47, jpff  wrote:
> > 
> > I want/need to have an instrument that at i-time turns off instr 15
> > and then schedules i15 for a little in the future
> > 
> > turnoff2 works at perf time ad schedule is OK for the second part but
> > how do I turn off i15 at i-time?  turnoff looks useful but the manual
> > is unclear (to me).  It looks as if I need to start i15 via nstance?
> > is that correct?  I would love an example
> > 
> > I have tried
> > 
> > 
> > which fails
> > 
> > and
> > instr 7
> > 
> >  turnoff gi15
> >  gi15 nstance 15, 0.3, 36000, 1, $LEN
> > 
> > endin
> > which complains with
> > new alloc for instr 7:
> > WARNING: instance not valid
> > 
> > Any help welcome -- I do not usually work in real time
> > ==John ffitch
> > 
> > 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

Date2016-03-14 21:21
FromPeter Burgess
SubjectRe: turnoff an instrument
I have been struggling with both turnoff and turnoff2 recently.

I was using turnoff2 much the same as you are but with with turnon
instead of scheduel, and for some reason it sounded like it highpass
filtered whichever instrument was being turned on. Weird...

My interpretation of the turnoff was also that it needs to be started
from nstance in order to store the handle. My issue here was that
nstance didn't actually seem to save any info to the handle, and so
turnoff could never turn it off. MY setup for nstance / turnoff was
much like yours. I initialised a giHandle to 0 before starting (to
store the instance handle to), and I printed the value of giHandle
every time I called the instrument. giHandle always remained at 0.

In your turnoff example above, you don't show the initialising of
gi15. I feel silly for asking you, but have you just omitted that from
your example or are you not initialising it? One thought I had was
that you might need a separate instrument to make the first call to
nstance without a prior call to turnoff, maybe calling turnoff without
an instance to refer to bugs it out in some way?

Pete

On Mon, Mar 14, 2016 at 9:10 PM, Victor Lazzarini
 wrote:
> I will have a look tomorrow at my computer, but I would have thought you could use schedule with negative p3 to turn it off and then schedule again to turn it on in the future.
>
> Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
>
>> On 14 Mar 2016, at 20:47, jpff  wrote:
>>
>> I want/need to have an instrument that at i-time turns off instr 15
>> and then schedules i15 for a little in the future
>>
>> turnoff2 works at perf time ad schedule is OK for the second part but
>> how do I turn off i15 at i-time?  turnoff looks useful but the manual
>> is unclear (to me).  It looks as if I need to start i15 via nstance?
>> is that correct?  I would love an example
>>
>> I have tried
>> instr 7
>>  turnoff2 15, 0, 0
>>  schedule 2, 0.5, $LEN, 1, $LEN
>> endin
>>
>> which fails
>>
>> and
>> instr 7
>>  turnoff gi15
>>  gi15 nstance 15, 0.3, 36000, 1, $LEN
>> endin
>> which complains with
>> new alloc for instr 7:
>> WARNING: instance not valid
>>
>> Any help welcome -- I do not usually work in real time
>> ==John ffitch
>>
>> 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


Date2016-03-15 09:15
FromVictor Lazzarini
SubjectRe: turnoff an instrument
Commit 072b944e44a732663e5ac19df61871d356bb466f broke the nstance opcode. So that’s why
it does not work. I am looking into it.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 14 Mar 2016, at 20:47, jpff  wrote:
> 
> I want/need to have an instrument that at i-time turns off instr 15
> and then schedules i15 for a little in the future
> 
> turnoff2 works at perf time ad schedule is OK for the second part but
> how do I turn off i15 at i-time?  turnoff looks useful but the manual
> is unclear (to me).  It looks as if I need to start i15 via nstance?
> is that correct?  I would love an example
> 
> I have tried
> instr 7
>  turnoff2 15, 0, 0
>  schedule 2, 0.5, $LEN, 1, $LEN
> endin
> 
> which fails
> 
> and
> instr 7
>  turnoff gi15
>  gi15 nstance 15, 0.3, 36000, 1, $LEN
> endin
> which complains with
> new alloc for instr 7:
> WARNING: instance not valid 
> 
> Any help welcome -- I do not usually work in real time
> ==John ffitch
> 
> 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

Date2016-03-15 10:01
FromPeter Burgess
SubjectRe: turnoff an instrument
Awesome! :D

On Tue, Mar 15, 2016 at 9:15 AM, Victor Lazzarini
 wrote:
> Commit 072b944e44a732663e5ac19df61871d356bb466f broke the nstance opcode. So that’s why
> it does not work. I am looking into it.
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 14 Mar 2016, at 20:47, jpff  wrote:
>>
>> I want/need to have an instrument that at i-time turns off instr 15
>> and then schedules i15 for a little in the future
>>
>> turnoff2 works at perf time ad schedule is OK for the second part but
>> how do I turn off i15 at i-time?  turnoff looks useful but the manual
>> is unclear (to me).  It looks as if I need to start i15 via nstance?
>> is that correct?  I would love an example
>>
>> I have tried
>> instr 7
>>  turnoff2 15, 0, 0
>>  schedule 2, 0.5, $LEN, 1, $LEN
>> endin
>>
>> which fails
>>
>> and
>> instr 7
>>  turnoff gi15
>>  gi15 nstance 15, 0.3, 36000, 1, $LEN
>> endin
>> which complains with
>> new alloc for instr 7:
>> WARNING: instance not valid
>>
>> Any help welcome -- I do not usually work in real time
>> ==John ffitch
>>
>> 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



-- 
http://algorythmradio.com
https://soundcloud.com/algorythmradio

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

Date2016-03-15 10:56
FromVictor Lazzarini
SubjectRe: turnoff an instrument
Ok, now with the latest develop code you can use nstance as you tried below,
I’ve fixed the regression bug.
========================
Dr Victor Lazzarini
Dean of Arts, Celtic Studies and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 14 Mar 2016, at 20:47, jpff  wrote:
> 
> I want/need to have an instrument that at i-time turns off instr 15
> and then schedules i15 for a little in the future
> 
> turnoff2 works at perf time ad schedule is OK for the second part but
> how do I turn off i15 at i-time?  turnoff looks useful but the manual
> is unclear (to me).  It looks as if I need to start i15 via nstance?
> is that correct?  I would love an example
> 
> I have tried
> instr 7
>  turnoff2 15, 0, 0
>  schedule 2, 0.5, $LEN, 1, $LEN
> endin
> 
> which fails
> 
> and
> instr 7
>  turnoff gi15
>  gi15 nstance 15, 0.3, 36000, 1, $LEN
> endin
> which complains with
> new alloc for instr 7:
> WARNING: instance not valid 
> 
> Any help welcome -- I do not usually work in real time
> ==John ffitch
> 
> 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

Date2016-03-15 12:35
FromPeter Burgess
SubjectRe: turnoff an instrument
Nice one! I'll rebuild shortly

On Tue, Mar 15, 2016 at 10:56 AM, Victor Lazzarini
 wrote:
> Ok, now with the latest develop code you can use nstance as you tried below,
> I’ve fixed the regression bug.
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 14 Mar 2016, at 20:47, jpff  wrote:
>>
>> I want/need to have an instrument that at i-time turns off instr 15
>> and then schedules i15 for a little in the future
>>
>> turnoff2 works at perf time ad schedule is OK for the second part but
>> how do I turn off i15 at i-time?  turnoff looks useful but the manual
>> is unclear (to me).  It looks as if I need to start i15 via nstance?
>> is that correct?  I would love an example
>>
>> I have tried
>> instr 7
>>  turnoff2 15, 0, 0
>>  schedule 2, 0.5, $LEN, 1, $LEN
>> endin
>>
>> which fails
>>
>> and
>> instr 7
>>  turnoff gi15
>>  gi15 nstance 15, 0.3, 36000, 1, $LEN
>> endin
>> which complains with
>> new alloc for instr 7:
>> WARNING: instance not valid
>>
>> Any help welcome -- I do not usually work in real time
>> ==John ffitch
>>
>> 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



-- 
http://algorythmradio.com
https://soundcloud.com/algorythmradio

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