This library contains functions for converting arrays of strings to number format and vice versa. They are needed when working with grid views because numbers must be converted to strings before adding them to a grid and columns and rows of strings in a grid must be converted back into numbers before they can be processed further with a script. You can find a script that demonstrates how these functions are used here.
Copy this library to the include folder of your Spiken folder in My Documents. To use these functions add the line #include “ghgridutils.s2s” at the top of your script.
This script requires Spike2 v8.06 or higher. From versions 8.14 and 9.02 onwards, this script will be added to the include folder of the Spike2 application.
SeqLib - a library of functions to help with calculations of sequencer variable values. SeqLib contains a much requested function; something that calculates the variable value required to set a DAC output to a specified voltage. This is the equivalent of the VDAC32() operator built into the sequence compiler but can be used in a much more flexible manner. Other SeqLib functions convert time to sequencer ticks and generate variable values suitable for writing to the digital outputs or controlling the cosine outputs.
This function randomises the order of items in an integer array. A typical application might be to randomise the order of presentation of common and rare auditory stimuli.
If you add these functions to your own scripts you can display Message boxes similar to those generated by the built-in Message() procedure but with the following extra features:
These procedures can be used to hide all the floating windows and toolbars etc. at the start of a script and restore them at the end. This maximises the available screen area during script operation. The gFloat%[] array should be a global at the start of your script.
These procedures are used in many CED scripts. The particular variant given here keeps the script window itself hidden. You can find a slightly simplified version of these procedures and further information under App() in the Spike2 Help index.
This Spike2 script procedure checks whether there is any text in the Log window. If the log contains text a Query box is displayed so that you can choose whether or not to clear the log before continuing. If you choose the answer No, the text caret is moved to the end of the log file. The procedure leaves the current view unchanged.
Add this function to the functions and procedures section of your own scripts. You can then call it at the beginning of script functions that write data to the log file or perhaps in the Quit() function, as an aid to keeping the log file in a tidy state.
This function allows you to set the enabled /disabled state of multiple toolbar buttons.
The ToolbarEnable() and ToolbarClear() script functions can only act on one (or all) buttons. Thus, you may need sequences of 4 or 5 calls to ToolbarEnable() at each point in the script where you need to set the enabled state of multiple buttons. The DoButtons%() function provides a method of setting the state of multiple buttons with a single function call. To use it, simply copy the DoButtons%() function into the functions and procedures section of your script and call it as illustrated in the example script.
Add this function to the functions and procedures section of your own scripts. You can then call it at the beginning of script functions that write data to the log file or perhaps in the Quit() function, as an aid to keeping the log file in a tidy state.
This function requires Spike2 v5.14 or higher.
Some of these scripts have come from users rather than the CED team. If you have a script that you would like to offer to fellow users via this page, please tell Simon Gray. We provide some scripts for Signal too.
These scripts are stored as WinZip files, myscript.zip, except where they are shown as spike\scripts\myscript.s2s. Those latter files were installed with Spike2 and spike stands for the directory in which you installed Spike2. See the summaries by clicking on the description in the side menu. Then you can down-load them by clicking on the filename.
Registered in England: 00972132
Registered office:
VAT: GB 214 2617 96
Producer registration number: WEE/BD0050TZ
For our US customers, we can provide tax form W-8BEN, that identifies us as a UK company.
(Int.+44) (0)1223 420186
1 800 345 7794