FLsavesnap FLTK:Other FLsavesnap FLsavesnap Saves all snapshots currently created into a file. Description Plugin opcode in widgets. This opcode is part of the plugin repository and has to be installed separately. These FLTK widgets do not work on the Mac. The plugin repository can be found here: https://github.com/csound/plugins FLsavesnap saves all snapshots currently created (i.e. the entire memory bank) into a file. Syntax FLsavesnap "filename" [, igroup] Initialization filename -- a double-quoted string corresponding to a file to store a bank of snapshots. igroup -- (optional) an integer number referring to a snapshot-related group of widget. It allows to get/set, or to load/save the state of a subset of valuators. Default value is zero that refers to the first group. The group number is determined by the opcode FLsetSnapGroup. The igroup parameter has not been yet fully implemented in the current version of csound. Please do not rely on it yet. Performance FLsavesnap saves all snapshots currently created (i.e. the entire memory bank) into a file whose name is filename. Since the file is a text file, snapshot values can also be edited manually by means of a text editor. The format of the data stored in the file is the following (at present time, this could be changed in next Csound version): ----------- 0 ----------- FLvalue 0 0 1 0 "" FLvalue 0 0 1 0 "" FLvalue 0 0 1 0 "" FLslider 331.946 80 5000 -1 "frequency of the first oscillator" FLslider 385.923 80 5000 -1 "frequency of the second oscillator" FLslider 80 80 5000 -1 "frequency of the third oscillator" FLcount 0 0 10 0 "this index must point to the location number where snapshot is stored" FLbutton 0 0 1 0 "Store snapshot to current index" FLbutton 0 0 1 0 "Save snapshot bank to disk" FLbutton 0 0 1 0 "Load snapshot bank from disk" FLbox 0 0 1 0 "" ----------- 1 ----------- FLvalue 0 0 1 0 "" FLvalue 0 0 1 0 "" FLvalue 0 0 1 0 "" FLslider 819.72 80 5000 -1 "frequency of the first oscillator" FLslider 385.923 80 5000 -1 "frequency of the second oscillator" FLslider 80 80 5000 -1 "frequency of the third oscillator" FLcount 1 0 10 0 "this index must point to the location number where snapshot is stored" FLbutton 0 0 1 0 "Store snapshot to current index" FLbutton 0 0 1 0 "Save snapshot bank to disk" FLbutton 0 0 1 0 "Load snapshot bank from disk" FLbox 0 0 1 0 "" ----------- 2 ----------- ..... etc... ----------- 3 ----------- ..... etc... --------------------------- As you can see, each snapshot contain several lines. Each snapshot is separated from previous and next snapshot by a line of this kind: "----------- snapshot Num -----------" Then there are several lines containing data. Each of these lines corresponds to a widget. The first field of each line is an unquoted string containing opcode name corresponding to that widget. Second field is a number that expresses current value of a snapshot. In current version, this is the only field that can be modified manually. The third and fourth fields shows minimum and maximum values allowed for that valuator. The fifth field is a special number that indicates if the valuator is linear (value 0), exponential (value -1), or is indexed by a table interpolating values (negative table numbers) or non-interpolating (positive table numbers). The last field is a quoted string with the label of the widget. Last line of the file is always "---------------------------" . Note that FLvalue andFLbox are not valuators and their values are fixed, so they cannot be modified. For purposes of snapshot saving, widgets can be grouped, so that snapshots affect only a defined group of widgets. The opcode FLsetSnapGroup is used to specify the group for all widgets declared after it, until the next FLsetSnapGroup statement. Examples Here is a simple example of the FLTK snapshot saving. It uses the file FLsavesnap_simple.csd. Example of FLTK snapshot saving. See the sections Real-time Audio and Command Line Flags for more information on using command line flags. Here is another example of FLTK snapshot saving using snapshot groups. It uses the file FLsavesnap.csd. Example of FLTK snapshot saving using snapshot groups. See the sections Real-time Audio and Command Line Flags for more information on using command line flags. See Also FLgetsnap, FLloadsnap, FLsetSnapGroup, FLrun, FLsetsnap, FLupdate Credits Author: &namegabriel; New in version 4.22