Audio Frequency Signal Generator in-app sequencer dedicated language : AFSGL.
This language allows to program sequences of events related to frequencies and audio output within Audio Frequency Signal Generator app.
Examples of code line :
freq 100 120
freq triangle 100 120
timeInterval 0.25
The syntax of AFSGL was designed to be mobile-friendly (even if you may prefer edit your code externally, which can be done via the sequencer program file export / import features) : Case insensitive, no commas, no parenthesis, no quotes, no semicolons, just simple commands with spaces and line breaks.
The code can be edited and run within the in-app sequencer (sequencer is available via the “Sequencer” button).
Code is displayed in the main text area (vertically scrollable area).
AFSGL allows two types of comments : Single-line comments (starting with “//”) and Multi-line comments (starting with “/*”, ending with “*/”).
The language version is displayed as a comment at the top of the code default template.
You can type code manually, as well as you can use the command selector :
A command selector is available on the right of the screen : When you select a command, it is automatically inserted into the code at the caret’s position. Then you just have to add arguments when needed (hints are displayed below the text area).
A Loop option is available, allowing you to repeat the current sequence of commands indefinitely.
A feature related to the Loop option is the once execution principle : Each command is provided with an optional “once” keyword : When using the “once” keyword just after a given command (e.g. freq once 120 124), the command will be executed once and only once, until you run the program again.
A “Record audio” option is also available. When this option is checked, the audio output starts recording as soon as the program is successfully compiled and starts.
The “Export” / “Import” buttons allow you to export / import your program to / from text files. The default file suffix is .afsgl, the files can be opened in any text editor.
Once your code is ready, hit the “Run” button : If compile succeeds, the program starts.
During the program execution, the virtual monitor (on the bottom left of the screen) logs informations, among which the number of valid commands found, as well as the current command.
AFSGL 1.0 : Description of available commands
freq
Sets the left and right frequency values.
Uses :
freq [optional keyword: once] [float : Left value] [float : Right value]
freq [optional keyword: once] [waveform name] [float : Left value] [float : Right value]
Examples :
freq 200 208
freq sine 198 400
freq once 198 400
freq once triangle 198 400
waveForm
Sets the waveform (Sine, Square, Triangle or Sawtooth).
Use :
waveForm [optional keyword: once] [string : Waveform name]
Examples :
waveForm square
waveForm once sawtooth
wait
Makes the sequencer wait before processing the next step (wait time expressed in seconds via a float value).
Use :
wait [optional keyword: once] [float : Duration in seconds]
Examples :
wait 0.5
wait once 2.6
volume
Sets the main volume (float value between 0 and 1).
Use :
volume [optional keyword: once] [float : Value between 0 and 1]
Examples :
volume 0.2
volume once 0.4
timeInterval
Sets the wait time between frequency changes (wait time expressed in seconds via a float value).
Use :
timeInterval [optional keyword: once] [float : Duration in seconds]
Examples :
timeInterval 0.25
timeInterval once 3.4
minFreq
Sets the minimum frequencies (float values).
Use :
minFreq [optional keyword: once] [float : Left value] [float : Right value]
Examples :
minFreq 40 40
minFreq once 10 10
maxFreq
Sets the maximum frequencies (float values).
Use :
maxFreq [optional keyword: once] [float : Left value] [float : Right value]
Examples :
maxFreq 1200 1305
maxFreq once 850 847
addFreq
Adds frequency values to the left and right frequencies (float values).
Use :
addFreq [optional keyword: once] [float : Left value] [float : Right value]
Examples :
addFreq 10 12
addFreq once 8 8
subFreq
Substracts frequency values from the left and right frequencies (float values).
Use :
subFreq [optional keyword: once] [float : Left value] [float : Right value]
Examples :
subFreq 23 25
subFreq once 4 4
sweep
Triggers a Sweep effect (start / end left and right frequency values, and optionally left and right steps values).
Uses :
sweep [optional keyword: once] [float : Start Left value] [float : Start Right value] [float : End Left value] [float : End Right value]
sweep [optional keyword: once] [float : Start Left value] [float : Start Right value] [float : End Left value] [float : End Right value] [float : Left Steps value] [float : Right Steps value]
Examples :
sweep 120 123 320 323 1 1
sweep once 20 23 1420 1423 10 10
sweepTo
Triggers a Sweep effect from the current frequency values to the desired frequency values (left and right values, and optionally left and right steps values).
Uses :
sweepTo [optional keyword: once] [float : Left value] [float : Right value]
sweepTo [optional keyword: once] [float : Left value] [float : Right value] [float : Left Steps value] [float : Right Steps value]
Examples :
sweepTo 320 323 1 1
sweepTo once 500 501 8 8
random
Sets a random waveform, and random left and right frequency values.
Use :
random [optional keyword: once]
Examples :
random
random once
randomFreq
Sets random left and right frequency values.
Use :
randomFreq [optional keyword: once]
Examples :
randomFreq
randomFreq once
randomFav
Random selects favorite waveform + frequency set.
Use :
randomFav [optional keyword: once]
Examples :
randomFav
randomFav once
randomWaveForm
Sets a random waveform : Sine, Square, Triangle or Sawtooth.
Use :
randomWaveForm [optional keyword: once]
Examples :
randomWaveForm
randomWaveForm once
audioReset
Resets audio output : Waveform is set to Sine, frequency left and right values are set to 440 hz, volume is set to 0.1.
Use :
audioReset [optional keyword: once]
Examples :
audioReset
audioReset once
audioOff
Mutes audio output.
Use :
audioOff [optional keyword: once]
Examples :
audioOff
audioOff once
audioOn
Unmutes audio output.
Use :
audioOn [optional keyword: once]
Examples :
audioOn
audioOn once