Csound Csound-dev Csound-tekno Search About

[Csnd] Csound in Bela - Trill (again)

Date2021-06-30 11:16
Fromluis antunes pena
Subject[Csnd] Csound in Bela - Trill (again)
Hello all,

I am currently using Bela for some projects and I'm running into a problem that I'm not sure it is because of csound in Bela and the Trill opcode or if it has to do with the arrays.

I'm using the Trill opcode with the Trill Bar reading the values of the vertical mouvement of the fingers. It works well with one finger but as soon as I use two fingers or more the second value is not actuallized. The actuallization happens only with the third finger and with the fifth. So both second and fourth finger are not readable.

All this doesn't happend if I use
printarray as in the Trill example.

Below the code I tried and thanks in advance for any help.

Best,

Luís

<CsoundSynthesizer>
<CsOptions>
-d
</CsOptions>
<CsInstruments>
ksmps = 8
nchnls = 2
0dbfs = 1

;------------------------------------------------------
;    Audio in/out and analoge in to control gain
;------------------------------------------------------

    instr 1
 iNumTouches = 5
 iTrillID = 0
 kactiveTouches init 0
 ktouchSizes[] init iNumTouches
 ktouchVert[] init iNumTouches
 ktouchHori[] init iNumTouches

kactiveTouches, ktouchSizes, ktouchVert, ktouchHori trill iNumTouches, iTrillID

;printk2 kactiveTouches
;ktrig_v changed2 ktouchVert
;ktrig_h changed2 ktouchHori
;ktrig = ktrig_v + ktrig_h
;printarray ktouchVert, ktrig_v, "","Vertical:"
;printarray ktouchHori, ktrig_h, "", "Horisontal"

; krnd1 random 0, 1
; ktouchVert[0] = krnd1
; krnd2 random 1, 2
; ktouchVert[1] = krnd2
; krnd3 random 2, 3
; ktouchVert[2] = krnd3

;make value vertical global
gkvert1 = ktouchVert[0]
gkvert2 = ktouchVert[1]
gkvert3 = ktouchVert[2]
gkvert4 = ktouchVert[3]
gkvert5 = ktouchVert[4]

printk2 gkvert1
printk2 gkvert2, 10
printk2 gkvert3, 20
printk2 gkvert4, 30
printk2 gkvert5, 40

    endin

</CsInstruments>
<CsScore>
i1 0 86400
</CsScore>
</CsoundSynthesizer>