[Csnd] FLsetText on FLButton

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Csnd] FLsetText on FLButton

Dominik K
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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] FLsetText on FLButton

jpff
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 <[hidden email]> 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
[hidden email]
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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] FLsetText on FLButton

Dominik K
In reply to this post by Dominik K
Thanks John,

to
a) commenting out the if/endif statements gets rid of...
error:  perf-pass statements illegal in header blk (cngoto)
however, it is not a K-rate operation is it?

commenting out the FLbutton lines gets rid of
error:  perf-pass statements illegal in header blk (##array_set.k)
but why? i can place a single button with a kout output value and CSound doesn't
show the error log.

to
b) still have no idea why CSound writes the same label ("b15") on each button

Best
Dominik

Csound mailing list
[hidden email]
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