| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
; Select audio/midi flags here according to platform |
| 4 |
; Audio out Audio in No messages |
| 5 |
-odac ; -iadc -d ;;;RT audio I/O |
| 6 |
; For Non-realtime ouput leave only the line below: |
| 7 |
; -o FLpanel-sensekey2.wav -W ;;; for file output any platform |
| 8 |
</CsOptions> |
| 9 |
<CsInstruments> |
| 10 |
sr = 48000 |
| 11 |
ksmps = 32 |
| 12 |
nchnls = 1 |
| 13 |
; Example by Istvan Varga |
| 14 |
; if the FLTK opcodes are commented out, sensekey will read keyboard |
| 15 |
; events from stdin |
| 16 |
FLpanel "", 150, 50, 100, 100, 0, 1 |
| 17 |
FLlabel 18, 10, 1, 0, 0, 0 |
| 18 |
FLgroup "Keyboard Input", 150, 50, 0, 0, 0 |
| 19 |
FLgroupEnd |
| 20 |
FLpanelEnd |
| 21 |
|
| 22 |
FLrun |
| 23 |
|
| 24 |
instr 1 |
| 25 |
|
| 26 |
ktrig1 init 1 |
| 27 |
ktrig2 init 1 |
| 28 |
nxtKey1: |
| 29 |
k1, k2 sensekey |
| 30 |
if (k1 != -1 || k2 != 0) then |
| 31 |
printf "Key code = %02X, state = %d\n", ktrig1, k1, k2 |
| 32 |
ktrig1 = 3 - ktrig1 |
| 33 |
kgoto nxtKey1 |
| 34 |
endif |
| 35 |
nxtKey2: |
| 36 |
k3 sensekey |
| 37 |
if (k3 != -1) then |
| 38 |
printf "Character = '%c'\n", ktrig2, k3 |
| 39 |
ktrig2 = 3 - ktrig2 |
| 40 |
kgoto nxtKey2 |
| 41 |
endif |
| 42 |
|
| 43 |
endin |
| 44 |
|
| 45 |
</CsInstruments> |
| 46 |
<CsScore> |
| 47 |
i 1 0 3600 |
| 48 |
e |
| 49 |
</CsScore> |
| 50 |
</CsoundSynthesizer> |