Csound Csound-dev Csound-tekno Search About

[Csnd] Button widgets (what is better?)

Date2019-09-23 11:18
FromBernard Geyer
Subject[Csnd] Button widgets (what is better?)
I use f.e. a "play"and a "stop" button to start a performance.

In CsoundQt I can have event-type buttons that send score events to csound
I define the event when I create the button:
i "play" 0 -1
i "stop" 0 0.1
There is just one thing that I don't like here: the event is sent when the
button is released, not when it is pushed. In this example, perhaps it
doesn't matter, but in other cases, it should be immediate.

In Cabbage it doesn't exist (or maybe I didn't see the documentation about
it), so I use:
kplay chnget "play"
kplayTrig changed kplay

if kplayTrig == 1 then
  if kplay == 1 then
    event "i", "play", 0, -1
  endif
endif
 
kstop chnget "stop"
kstopTrig changed kstop

if kstopTrig == 1 then
  if kstop == 1 then
    event "i", "stop", 0, 0.1
  endif
endif

Is the first example is faster when there are many widgets ?




--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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

Date2019-10-10 20:14
FromRory Walsh
SubjectRe: [Csnd] Button widgets (what is better?)
Sorry, I thought I had replied to this some time ago. I don' think there will be much, if any difference between sending a score event sending it from within an orchestra. 

On Fri, 27 Sep 2019 at 11:58, Bernard Geyer <micamusic2@gmail.com> wrote:
I use f.e. a "play"and a "stop" button to start a performance.

In CsoundQt I can have event-type buttons that send score events to csound
I define the event when I create the button:
i "play" 0 -1
i "stop" 0 0.1
There is just one thing that I don't like here: the event is sent when the
button is released, not when it is pushed. In this example, perhaps it
doesn't matter, but in other cases, it should be immediate.

In Cabbage it doesn't exist (or maybe I didn't see the documentation about
it), so I use:
kplay chnget "play"
kplayTrig changed kplay

if kplayTrig == 1 then
  if kplay == 1 then
    event "i", "play", 0, -1
  endif
endif

kstop chnget "stop"
kstopTrig changed kstop

if kstopTrig == 1 then
  if kstop == 1 then
    event "i", "stop", 0, 0.1
  endif
endif

Is the first example is faster when there are many widgets ?




--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

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