Csound Csound-dev Csound-tekno Search About

[Csnd] FLsetText on FLButton

Date2017-09-23 18:54
FromDominik K <00000289a377b150-dmarc-request@LISTSERV.HEANET.IE>
Subject[Csnd] FLsetText on FLButton
Dear all,
i am struggling with the piece of code below in that i am

a) getting two error messages:
  error:  perf-pass statements illegal in header blk (##array_set.k)
  error:  perf-pass statements illegal in header blk (cngoto)

b) the buttons get created and displayed and the prints opcode writes the following line to the console:
b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15
However, on each of the 16 buttons it reads: "b15"

I specifically chose array to avoid overwriting of the buttons.

Any hints?
Thanks in advance
Dominik

; --------------------------------------------------------------------


  -odac -d --midi-key-cps=4 --midi-velocity=5


  sr = 44100
  ksmps = 64
  nchnls = 2
  0dbfs = 1
  giSine ftgen 1, 0, 2^10, 10, 1
  giSeq1a ftgen 200, 0, 2^4, -2, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0
  ; gui...
  FLpanel "Control", 800, 400, 100, 100, 5, 1 ; start of container
    iButSize = 50
    iLength ftlen giSeq1a
    gkSeqArray[] init iLength
    giHaButArray[] init iLength
    iCount = 0
    gSeqStr[] init iLength
    loop:
      itemp = (iButSize*iCount)
      gkSeqArray[iCount], giHaButArray[iCount] FLbutton "", 1, 0, 2,\; "label", ion, ioff, itype
        iButSize, iButSize, itemp, 0, -1; iwidth, iheight, ix, iy, iopcode        
      iTab table iCount, giSeq1a 
      gSeqStr[iCount] sprintf "b%d ", iCount
      prints gSeqStr[iCount]
      FLsetText gSeqStr[iCount], giHaButArray[iCount]
      if (iTab == 1) then
        FLsetVal_i 1, giHaButArray[iCount]
      endif
    loop_lt iCount, 1, iLength, loop
  FLpanelEnd; end of container
  FLrun; runs the widget thread
  ; --------------------------------------------------------------------

; --------------------------------------------------------------------

t 0 120; tempo
i1 0 3600




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

Date2017-09-23 19:41
FromJohn ff
SubjectRe: [Csnd] FLsetText on FLButton
Krate operations are not allowed in instr 0.  This is somewhat relaxed in the next version.  That explains the first problems


Sent from Blue
On 23 Sep 2017, at 19:04, Dominik K <00000289a377b150-dmarc-request@LISTSERV.HEANET.IE> wrote:
Dear all,
i am struggling with the piece of code below in that i am

a) getting two error messages:
error: perf-pass statements illegal in header blk (##array_set.k)
error: perf-pass statements illegal in header blk (cngoto)

b) the buttons get created and displayed and the prints opcode writes the following line to the console:
b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15
However, on each of the 16 buttons it reads: "b15"

I specifically chose array to avoid overwriting of the buttons.

Any hints?
Thanks in advance
Dominik

;

<CsoundSynthesizer>
<CsOptions>
-odac -d --midi-key-cps=4 --midi-velocity=5
</CsOptions>
<CsInstruments>
sr = 44100
ksmps = 64
nchnls = 2
0dbfs = 1
giSine ftgen 1, 0, 2^10, 10, 1
giSeq1a ftgen 200, 0, 2^4, -2, 1, 0, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0
; gui...
FLpanel "Control", 800, 400, 100, 100, 5, 1 ; start of container
iButSize = 50
iLength ftlen giSeq1a
gkSeqArray[] init iLength
giHaButArray[] init iLength
iCount = 0
gSeqStr[] init iLength
loop:
itemp = (iButSize*iCount)
gkSeqArray[iCount], giHaButArray[iCount] FLbutton "", 1, 0, 2,\; "label", ion, ioff, itype
iButSize, iButSize, itemp, 0, -1; iwidth, iheight, ix, iy, iopcode
iTab table iCount, giSeq1a
gSeqStr[iCount] sprintf "b%d ", iCount
prints gSeqStr[iCount]
FLsetText gSeqStr[iCount], giHaButArray[iCount]
if (iTab == 1) then
FLsetVal_i 1, giHaButArray[iCount]
endif
loop_lt iCount, 1, iLength, loop
FLpanelEnd; end of container
FLrun; runs the widget thread
;

</CsInstruments>
;

<CsScore>
t 0 120; tempo
i1 0 3600

</CsScore>
</CsoundSynthesizer>

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