📄 experiment4.gel
字号:
/*
* This GEL script simulates user input/output; there is one switch
* (selection of which channel will be output), and two sliders
* (volume gain for each channel). A "switch" is implemented as a
* slider that goes from 0 to 1 in steps of 1. On the target, a procedure
* periodically runs that checks these values, which simulate a part
* of the I/O space.
*
* Each control writes a value in the simulated device controls' IO area,
* i.e. in the target's array called deviceControlsIOArea[1 + 1 + NUMCHANNELS].
* Element[0] indicates whether there has been any user input
* Element[1] is the number of the channel that should be used for the
* output, and [2 + i] is the volume for channel i.
* When the script changes any of the values, it also sets element [0]
* to non-zero, and indication for the thread on the target that there
* has been new user input.
*/
menuitem "Equalizer Control";
/*
* Variable gain control 0
* It goes from 0 to 25 where 0 is the default,
* In increments of 1 and "page increments" of 1.
* 0 will correspond to -infinite db
* 1 to 24 will correspond to -12db to 12 db
*/
slider band0(0, 25, 1, 1, c0gain)
{
deviceControlsIOArea[2] = c0gain; /* set gain for channel 0 */
deviceControlsIOArea[0] = 1; /* indicate new user input */
}
/*
* Variable gain control 0
* It goes from 0 to 25 where 0 is the default,
* In increments of 1 and "page increments" of 1.
* 0 will correspond to -infinite db
* 1 to 24 will correspond to -12db to 12 db
*/
slider band1(0, 25, 1, 1, c1gain)
{
deviceControlsIOArea[3] = c1gain; /* set gain for channel 1 */
deviceControlsIOArea[0] = 1; /* indicate new user input */
}
/*
* Variable gain control 0
* It goes from 0 to 25 where 0 is the default,
* In increments of 1 and "page increments" of 1.
* 0 will correspond to -infinite db
* 1 to 24 will correspond to -12db to 12 db
*/
slider band2(0, 25, 1, 1, c2gain)
{
deviceControlsIOArea[4] = c2gain; /* set gain for channel 1 */
deviceControlsIOArea[0] = 1; /* indicate new user input */
}
/*
* Variable gain control 0
* It goes from 0 to 25 where 0 is the default,
* In increments of 1 and "page increments" of 1.
* 0 will correspond to -infinite db
* 1 to 24 will correspond to -12db to 12 db
*/
slider band3(0, 25, 1, 1, c3gain)
{
deviceControlsIOArea[5] = c3gain; /* set gain for channel 1 */
deviceControlsIOArea[0] = 1; /* indicate new user input */
}
/*
* Variable gain control 0
* It goes from 0 to 25 where 0 is the default,
* In increments of 1 and "page increments" of 1.
* 0 will correspond to -infinite db
* 1 to 24 will correspond to -12db to 12 db
*/
slider band4(0, 25, 1, 1, c4gain)
{
deviceControlsIOArea[6] = c4gain; /* set gain for channel 1 */
deviceControlsIOArea[0] = 1; /* indicate new user input */
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -