Use Non-Frames Version Previous Page Next Page
Instrument Control: Sensing and Control

button, checkbox

  kr      button     inum
  kr      checkbox   inum

Description

Sense on-screen controls. Requires Winsound or TCL/TK.

Initialization

inum – the number of the button or checkbox. If it does not exist, it is made on-screen at initialization.

Performance

If the button has been pushed since the last k-period, then return 1, otherwise return 0. If the checkbox is set (pushed) then return 1, if not, return 0.

Example

Increase pitch while a checkbox is set, and extend duration for each push of a button.

          instr 1
  kcps    =          cpsoct(p5)
  k1      check      1
          if (k1 == 1) kcps = kcps * 1.1
  a1      oscil      p4, kcps, 1
          out        a1

  k2      button     1
         if (k2 == 1) p3 = p3 + 0.1
         endin

Author

John ffitch
University of Bath, Codemist. Ltd.
Bath, UK
September, 2000
New in Csound version 4.08


Use Non-Frames Version Previous Page Next Page
Instrument Control: Sensing and Control