[Csnd] FLTK snapshots
Date | 2008-01-06 22:18 |
From | Lou Cohen |
Subject | [Csnd] FLTK snapshots |
I’ve been creating an fltk-based front end to my csound improviser lately. I’ve developed a number of techniques for creating the widgets more or less easily, and the work is showing promise. However, I ran into a problem with commands FLsavesnap and Flloadsnap. When I invoke the former (by clicking a button in the GUI, which is supposed to fire up instr 1200) a window shows up asking me if I really want to overwrite the file snapsave.txt. This is because I’ve saved the file a few times already. I say “yes” and the window goes away. The file snapsave.txt appears to be created correctly — it’s quite long and I haven’t inspected it all, but I can’t see anything obviously wrong with it. Then I want to retrieve this file, so I click another button which invokes instr 1205. Here’s what happens, based on the print lines I’ve inserted:
Any ideas as to what’s happening? Thanks! My version of csound (on OS X): Csound version 5.04.0 (float samples) Nov 10 2006 libsndfile-1.0.16 I have been afraid to update csound because of complications with MacCsound, which I still depend on for performance. -Lou Cohen ;-------------------------------------------- instr 1200 ;invoked to save a snapshot of fltk setting index init 0 ktrigger init 1 if(ktrigger==1)then inumsnap, inumval FLsetsnap index print inumsnap print inumval FLsavesnap "snapsave.txt" ktrigger = 0 FLsetVal ktrigger, 0, gibutsavebtnha endif endin ;------------------------------------------------ instr 1205 ;invoked to restore saved snapshot index init 0 itrigger init 1 if(itrigger==1) then FLloadsnap "snapsave.txt" inumsnap FLgetsnap index print inumsnap itrigger = 0 endif endin CONSOLE PRINTOUT: instr 1200: inumsnap = 0.000 instr 1200: inumval = 385.000 instr 1205: inumsnap = 2.000 instr 1200: inumsnap = 2.000 instr 1200: inumval = 385.000 ------------all lines below are printed after I click “yes” or “no” to the “are you sure...” dialog instr 1205: inumsnap = 3.000 instr 1200: inumsnap = 3.000 instr 1200: inumval = 385.000 instr 1205: inumsnap = 4.000 instr 1200: inumsnap = 4.000 instr 1200: inumval = 385.000 --------------------------- Permanent email: loucohen@jolc.net Music and video: http://ruccas.org/wiki.pl/Lou_Cohen More music and video: http://www.youtube.com/loucohen Astronomy: http://www.jolc.net ---------------------------- |
Date | 2008-01-07 02:41 |
From | "Steven Yi" |
Subject | [Csnd] Re: FLTK snapshots |
Attachments | None |
Date | 2008-01-07 10:18 |
From | "Oeyvind Brandtsegg" |
Subject | [Csnd] Re: Re: FLTK snapshots |
Attachments | None |
Date | 2008-01-07 16:56 |
From | Lou Cohen |
Subject | [Csnd] Re: FLTK snapshots, and a new question -MACRO EXPANSION |
Your observations were exactly correct. I can now save and restore a single snapshot with no problems. I’ll expand that to alternate snapshots sometime in the future, once I get more of the improviser running. May I ask a further question? To generate all the sliders, buttons, etc., I have devised a series of orchestra macros. They apparently create thousands of lines of code. So far, whenever I’ve made a mistake I’ve been able, with ingenuity, to find and fix the error. But I was wondering, is there any way to view the expanded orchestra code? This could possibly save me some time in the future. -Lou On 1/7/08 5:18, "Oeyvind Brandtsegg " <obrandts@gmail.com> wrote: Just an idea, --------------------------- Permanent email: loucohen@jolc.net Music and video: http://ruccas.org/wiki.pl/Lou_Cohen More music and video: http://www.youtube.com/loucohen Astronomy: http://www.jolc.net ---------------------------- |
Date | 2008-01-10 08:46 |
From | "Oeyvind Brandtsegg" |
Subject | [Csnd] Re: Re: FLTK snapshots, and a new question -MACRO EXPANSION |
Attachments | None |