<CsoundSynthesizer>
<CsOptions>

-+P

</CsOptions>
<CsInstruments>
sr=44100
kr=441
ksmps=100
nchnls=2

;zakinit	1, 120

giElem		init	100

giSine		ftgen	10,0,1024, 10, 1

giOutTab		ftgen	1,0,256, -2,   0

giMinMaxTab	ftgen	2,0,256, -2,   	0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, \
					0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, \
					0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, \
					0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, \
					0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, \
					0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, \
					0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, \
					0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, \
					0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, \
					0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, \
					0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, \
					0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1, 0,1 

giExpTab		ftgen	3,0,128, -2,	0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 \
					0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 \
					0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 \
					0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 \
					0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 

giFreqTab		ftgen	4,0,128, -7,   1,giElem,giElem+1

	FLpanel	"This Panel contains a Slider Bank",400,400
gkPitch,ih1 FLslider	"Base pitch", 25, 5000, -1, 1, -1,  300, 20, 50, 10
	FLscroll	400, 350, 0, 50
	FLcolor	-2
	FLslidBnk	" ", giElem, giOutTab , 300 , giElem*20, 50, 10,  -12 , giExpTab, 0, giMinMaxTab
	FLcolor	-1
	FLscroll_end
	FLpanel_end
	

	FLpanel	"Snapshots", 400, 500, 430

ihx1	FLbox	"STORE AND RETREIVE SNAPSHOTS",1,1,14,360,20,20,55
	FLsetTextSize	35, ihx1
	FLsetTextColor 150,150,150,ihx1
	FLsetTextType 5,ihx1
	FLsetFont 2,ihx1	
gkCheck,ih4	FLbutton	"0=retrieve 1=store",1,0,14, 108,50,10,140,   -1


gk9,ih	FLbutton	"Store snapshot to current index",  3,0, 11,150,40,200,140,    0,7,0,0
gk9,ih	FLbutton	"Save snapshot bank to disk", 1,0, 11,130,40,200,210,    0,5,0,0
gk9,ih	FLbutton	"Load snapshot bank from disk", 1,0, 11,150,40,20,210,    0,6,0,0

gkGet,ih	FLbutBank	12, 8,8,       360,180, 20,260,    0,7,0,0
ihx2	FLbox	"This button bank allows to store/retrieve snapshots,according to the state of the round button",1,1,14,360,20,20,180+270
	FLsetFont 4,ihx2
	FLsetTextType 5,ihx2

	FLpanel_end

	FLrun
FLsetVal_i	60, ih1	
	tb0_init	giOutTab


;///////////////////////////
	instr	1
;///////////////////////////
a1	adsynt	3000, gkPitch, giSine, giFreqTab, giOutTab, giElem
	outs	a1,a1
	endin






	instr	5
	FLsavesnap	"SliderBank_snap.txt"
	endin

	instr	6
	FLloadsnap	"SliderBank_snap.txt"
	endin

	instr	7
if i(gkCheck) == 0 goto then
	inumsnap,	inumval FLsetsnap	i(gkGet)
	goto endif
then:
	inumel	FLgetsnap	i(gkGet)
endif:
	endin


</CsInstruments>
<CsScore>

i1 0 3600
f0 3600

</CsScore>
</CsoundSynthesizer>
