Csound Csound-dev Csound-tekno Search About

[Csnd-dev] sensekey

Date2024-03-13 14:13
Fromjoachim heintz
Subject[Csnd-dev] sensekey
hi all -

a friend of mine used two sensekey opcodes in two instruments, and was 
wondering why the second one is ignored.

is this expected behaviour?  (it is not mentioned in the manual.)

would it be easy to change it, and allow more than one instance?

below an example; comment out "schedule(1,0,-1)" to see the difference.

	joachim


instr 1
   gkKey_1 sensekey
endin
schedule(1,0,-1)

instr 2
   gkKey_2 sensekey
endin
schedule(2,0,-1)

instr 3
   if (changed(gkKey_1) == 1) then
     printks("gkKey_1 = %d\n",0,gkKey_1)
   endif
   if (changed(gkKey_2) == 1) then
     printks("gkKey_2 = %d\n",0,gkKey_2)
   endif
endin
schedule(3,0,-1)

Date2024-03-13 14:42
FromVictor Lazzarini
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] sensekey
I think once it’s been sensed by one instrument, it is taken off the list. That looks like what is
happening. Not sure what the behaviour should be and whether there is a problem implementing any different.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 13 Mar 2024, at 14:13, joachim heintz  wrote:
> 
> *Warning*
> 
> This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> 
> hi all -
> 
> a friend of mine used two sensekey opcodes in two instruments, and was
> wondering why the second one is ignored.
> 
> is this expected behaviour?  (it is not mentioned in the manual.)
> 
> would it be easy to change it, and allow more than one instance?
> 
> below an example; comment out "schedule(1,0,-1)" to see the difference.
> 
>       joachim
> 
> 
> instr 1
>  gkKey_1 sensekey
> endin
> schedule(1,0,-1)
> 
> instr 2
>  gkKey_2 sensekey
> endin
> schedule(2,0,-1)
> 
> instr 3
>  if (changed(gkKey_1) == 1) then
>    printks("gkKey_1 = %d\n",0,gkKey_1)
>  endif
>  if (changed(gkKey_2) == 1) then
>    printks("gkKey_2 = %d\n",0,gkKey_2)
>  endif
> endin
> schedule(3,0,-1)