Csound Csound-dev Csound-tekno Search About

[Csnd] Several held notes with the same instrument

Date2020-06-12 14:07
From"Jeanette C."
Subject[Csnd] Several held notes with the same instrument
Hey hey,
I have an instrument to gather audio and output it to a master "Mixer". This 
instrument needs to be called for every new channel, so it has different 
p-fields, beginning with p4. It appears however that only the last instance of 
this instrument runs. All of them get started, but apparently quit as soon as 
a new one comes along.

Please, what can I do about it? Instruments are started with schedule .

Best wishes,

Jeanette

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * SoundCloud: https://soundcloud.com/jeanette_c
  * Twitter: https://twitter.com/jeanette_c_s
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

E-mail my heart and say our love will never die... <3
(Britney Spears)

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

Date2020-06-12 14:14
FromOeyvind Brandtsegg
SubjectRe: [Csnd] Several held notes with the same instrument
Hi,
do you have a minimal example?
all best
Oeyvind

fre. 12. jun. 2020 kl. 15:07 skrev Jeanette C. <julien@mail.upb.de>:
Hey hey,
I have an instrument to gather audio and output it to a master "Mixer". This
instrument needs to be called for every new channel, so it has different
p-fields, beginning with p4. It appears however that only the last instance of
this instrument runs. All of them get started, but apparently quit as soon as
a new one comes along.

Please, what can I do about it? Instruments are started with schedule .

Best wishes,

Jeanette

--
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * SoundCloud: https://soundcloud.com/jeanette_c
  * Twitter: https://twitter.com/jeanette_c_s
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

E-mail my heart and say our love will never die... <3
(Britney Spears)

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

Date2020-06-12 14:21
From"Jeanette C."
SubjectRe: [Csnd] Several held notes with the same instrument
Jun 12 2020, Oeyvind Brandtsegg has written:

> Hi,
> do you have a minimal example?
...
Hi,
this does it, I think:
*** CUT ***


-o dac -d --messagelevel=2

; ==============================================


sr	=	48000
ksmps	=	1
nchnls	=	2
0dbfs	=	1

instr Jobby
 	Sname init p4

 	prints "\nStarted jobby %s", Sname
 	printks "\nJobby %s running", 1, Sname
endin

instr RunJobby
 	Sname init p4
 	prints "\nPreparing to run new jobby %s", Sname
 	schedule "Jobby", 0, -1, Sname
 	turnoff
endin


; ==============================================

f0 20
i"RunJobby" 0 .1 "Work"
i"RunJobby" 0 .1 "Task"
i"RunJobby" .1 .1 "Job"
e


*** CUT ***

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * SoundCloud: https://soundcloud.com/jeanette_c
  * Twitter: https://twitter.com/jeanette_c_s
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

E-mail my heart and say our love will never die... <3
(Britney Spears)

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

Date2020-06-12 14:30
FromSteven Yi
SubjectRe: [Csnd] Several held notes with the same instrument
Looks like you'll need fractional instruments, otherwise the new instances will tie to the old one and reinit the existing instance.  You should be able to use something like:

gicount = 0

...
inum = nstrnum("Jobby") + gicount/100
gicount += 1
schedule(inum, 0, -1, Sname)


On Fri, Jun 12, 2020 at 9:21 AM Jeanette C. <julien@mail.upb.de> wrote:
Jun 12 2020, Oeyvind Brandtsegg has written:

> Hi,
> do you have a minimal example?
...
Hi,
this does it, I think:
*** CUT ***
<CsoundSynthesizer>
<CsOptions>
-o dac -d --messagelevel=2
</CsOptions>
; ==============================================
<CsInstruments>

sr      =       48000
ksmps   =       1
nchnls  =       2
0dbfs   =       1

instr Jobby
        Sname init p4

        prints "\nStarted jobby %s", Sname
        printks "\nJobby %s running", 1, Sname
endin

instr RunJobby
        Sname init p4
        prints "\nPreparing to run new jobby %s", Sname
        schedule "Jobby", 0, -1, Sname
        turnoff
endin

</CsInstruments>
; ==============================================
<CsScore>
f0 20
i"RunJobby" 0 .1 "Work"
i"RunJobby" 0 .1 "Task"
i"RunJobby" .1 .1 "Job"
e
</CsScore>
</CsoundSynthesizer>
*** CUT ***

--
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * SoundCloud: https://soundcloud.com/jeanette_c
  * Twitter: https://twitter.com/jeanette_c_s
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

E-mail my heart and say our love will never die... <3
(Britney Spears)

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

Date2020-06-12 15:08
From"Jeanette C."
SubjectRe: [Csnd] Several held notes with the same instrument
Thanks Steven, this has done the trick!
Jun 12 2020, Steven Yi has written:

> Looks like you'll need fractional instruments, otherwise the new instances
> will tie to the old one and reinit the existing instance.  You should be
> able to use something like:
>
> gicount = 0
>
> ...
> inum = nstrnum("Jobby") + gicount/100
> gicount += 1
> schedule(inum, 0, -1, Sname)
>
>
> On Fri, Jun 12, 2020 at 9:21 AM Jeanette C.  wrote:
>
>> Jun 12 2020, Oeyvind Brandtsegg has written:
>>
>>> Hi,
>>> do you have a minimal example?
>> ...
>> Hi,
>> this does it, I think:
>> *** CUT ***
>> 
>> 
>> -o dac -d --messagelevel=2
>> 
>> ; ==============================================
>> 
>>
>> sr      =       48000
>> ksmps   =       1
>> nchnls  =       2
>> 0dbfs   =       1
>>
>> instr Jobby
>>         Sname init p4
>>
>>         prints "\nStarted jobby %s", Sname
>>         printks "\nJobby %s running", 1, Sname
>> endin
>>
>> instr RunJobby
>>         Sname init p4
>>         prints "\nPreparing to run new jobby %s", Sname
>>         schedule "Jobby", 0, -1, Sname
>>         turnoff
>> endin
>>
>> 
>> ; ==============================================
>> 
>> f0 20
>> i"RunJobby" 0 .1 "Work"
>> i"RunJobby" 0 .1 "Task"
>> i"RunJobby" .1 .1 "Job"
>> e
>> 
>> 
>> *** CUT ***
>>
>> --
>>   * Website: http://juliencoder.de - for summer is a state of sound
>>   * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
>>   * SoundCloud: https://soundcloud.com/jeanette_c
>>   * Twitter: https://twitter.com/jeanette_c_s
>>   * Audiobombs: https://www.audiobombs.com/users/jeanette_c
>>   * GitHub: https://github.com/jeanette-c
>>
>> E-mail my heart and say our love will never die... <3
>> (Britney Spears)
>>
>> 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
>

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * SoundCloud: https://soundcloud.com/jeanette_c
  * Twitter: https://twitter.com/jeanette_c_s
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

E-mail my heart and say our love will never die... <3
(Britney Spears)

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