Skip to content

Instantly share code, notes, and snippets.

@abramhindle
Created October 28, 2018 22:02
Show Gist options
  • Save abramhindle/fda269a2665dc27a1f23a9ef0ece6646 to your computer and use it in GitHub Desktop.
Save abramhindle/fda269a2665dc27a1f23a9ef0ece6646 to your computer and use it in GitHub Desktop.
CSound FLgetsnap bug?
<CsoundSynthesizer>
<CsOptions>
-L stdin -odac -iadc ;;;RT audio I/O
;-L stdin -odac -iadc -dm6 -+rtaudio=jack -+jack_client=csoundNN -b 1024 -B 2048 ;;;RT audio I/O
</CsOptions>
<CsInstruments>
;; Bug report:
;; Goal: save state in memory of FLTK widgets
;;
;; Clicking SAVE suggests it is saving the network and it can print the output of FLsetsnap
;; But clicking LOAD does not print anything after it and does not set the FLTK widgets
;;
;; e.g. clicking save
;;
;; rtevent: T 71.654 TT 71.654 M: 0.00000 0.00000
;; SAVE: SET SNAP 1
;; setsnap saving
;; isnap inumel 2 8
;;
;; e.g. clicking load
;;
;; LOAD: GET SNAP 1
;; rtevent: T 51.462 TT 51.462 M: 0.00000 0.00000
;;
;; Versions affected: 6.13 beta and 6.05 (ubuntu)
;;
;; @piggy:~/src/csound/cs6make$ lsb_release -a
;; No LSB modules are available.
;; Distributor ID: Ubuntu
;; Description: Ubuntu 16.04.5 LTS
;; Release: 16.04
;; Codename: xenial
;; @piggy:~/src/csound/cs6make$ lsb_uname -a
;; lsb_uname: command not found
;; @piggy:~/src/csound/cs6make$ uname -a
;; Linux piggy 4.4.0-137-lowlatency #163-Ubuntu SMP PREEMPT Mon Sep 24 14:44:15 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
;;
;;
sr = 48000
ksmps = 16
nchnls = 2
0dbfs = 1
FLpanel "Network",500,430
imin = -1
imax = 1
islw = 500
islh = 50
itype = 5
ioff = islh
ibl = 430 - 100 - 50
gkw1_0_0, giww1_0_0 FLslider "1_0_0", imin, imax, 0, itype, -1, islw, islh, 0, ioff*(1)
gkw1_1_0, giww1_1_0 FLslider "1_1_0", imin, imax, 0, itype, -1, islw, islh, 0, ioff*(2)
gkw1_2_0, giww1_2_0 FLslider "1_2_0", imin, imax, 0, itype, -1, islw, islh, 0, ioff*(3)
gkw1_3_0, giww1_3_0 FLslider "1_3_0", imin, imax, 0, itype, -1, islw, islh, 0, ioff*(4)
kb1, ib1 FLbutton "0" , 1, 0, 1, 50, 50, 0, ibl, 105, 1000, 0, kr/sr
kb2, ib2 FLbutton "Rand", 1, 0, 1, 50, 50, 50, ibl, 105, 701, 0, kr/sr
kb3, ib3 FLbutton "LOAD", 1, 0, 1, 50, 50, 400, ibl, 105, 6000, 0, kr/sr
kb4, ib4 FLbutton "SAVE", 1, 0, 1, 50, 50, 350, ibl, 105, 6001, 0, kr/sr
FLpanel_end ;***** end of container
FLrun ;***** runs the widget thread
instr 6000
printf_i "LOAD: GET SNAP %i\n", 1, 1
inumel FLgetsnap 0
inumel FLgetsnap 1
printf "inumel %i \n", 1, inumel
printf "i am never reached! %i \n", 1 , 1
endin
instr 6001
printf_i "SAVE: SET SNAP %i\n", 1, 1
isnap, inumel FLsetsnap 1
printf_i "isnap inumel %i %i \n", 1, isnap, inumel
endin
instr 1000;;;; "zero"
gkw1_0_0 = 0
FLsetVal_i 0, giww1_0_0
gkw1_1_0 = 0
FLsetVal_i 0, giww1_1_0
gkw1_2_0 = 0
FLsetVal_i 0, giww1_2_0
gkw1_3_0 = 0
FLsetVal_i 0, giww1_3_0
p3 = 0
endin
instr 701 ;;;; "randomize"
iv_1_0_0 = rnd(2) - 1
gkw1_0_0 = iv_1_0_0
FLsetVal_i iv_1_0_0, giww1_0_0
iv_1_1_0 = rnd(2) - 1
gkw1_1_0 = iv_1_1_0
FLsetVal_i iv_1_1_0, giww1_1_0
iv_1_2_0 = rnd(2) - 1
gkw1_2_0 = iv_1_2_0
FLsetVal_i iv_1_2_0, giww1_2_0
iv_1_3_0 = rnd(2) - 1
gkw1_3_0 = iv_1_3_0
FLsetVal_i iv_1_3_0, giww1_3_0
p3 = 0
endin
</CsInstruments>
<CsScore>
t 0 60
f 0 3600
e
</CsScore>
</CsoundSynthesizer>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment