AFSGL

Welcome to the Audio Frequency Signal Generator in-app sequencer dedicated language : AFSGL !

This language aims at letting you easily program sequences of commands related to frequencies and audio output within your Audio Frequency Signal Generator app.

The first version of the language is pretty simple (e.g no variables : only literal values.), but it will still allow you to do a lot of things.

The syntax of AFSGL was designed to be mobile-friendly (even if you may prefer edit your code externally, which is easily feasible thanks to 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.

E.g. :

freq 100 120

freq triangle 100 120

Audio Frequency Signal Generator sequencer,
based on AFSGL language.

AFSGL allows two types of comments : Single-line comments (“//”) and Multi-line comments (“/**/”).

The language version is displayed as a comment at the top of the code default template.

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).

A command selector is available on the right of the screen : When you select a command, it is automatically inserted into the code with a line break, 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.

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, you hit the “run” button : If compile succeeds, the program starts.

During the program execution, the virtual monitor (at the bottom left of the screen) logs useful informations, among which the number of valid commands found, as well as the current command.

Description of the commands available in AFSGL 1.0

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]

e.g. :

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]

e.g. :

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]

e.g. :

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]

e.g. :

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]

e.g. :

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]

e.g. :

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]

e.g. :

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]

e.g. :

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]

e.g. :

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]

e.g. :

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]

e.g. :

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]

e.g. :

random

random once

randomFreq : Sets random left and right frequency values.

Use :

randomFreq [optional keyword: once]

e.g. :

randomFreq

randomFreq once

randomFav : Random selects favorite waveform + frequency set.

Use :

randomFav [optional keyword: once]

e.g. :

randomFav

randomFav once

randomWaveForm : Sets a random waveform : Sine, Square, Triangle or Sawtooth.

Use :

randomWaveForm [optional keyword: once]

e.g. :

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]

e.g. :

audioReset

audioReset once

audioOff : Mutes audio output.

Use :

audioOff [optional keyword: once]

e.g. :

audioOff

audioOff once

audioOn : Unmutes audio output.

Use :

audioOn [optional keyword: once]

e.g. :

audioOn

audioOn once

Spread the love