Skip to content

Oniric Forge

  • Home
  • AFSG
    • Frequency List
    • Audio Frequency Signal Generator
    • Oniric Forge – Audio Device Project
    • AFSGL
  • Apps
    • Slideshow Video Generator
    • Audio Frequency Signal Generator
    • Injection Planning
    • Tiny Labyrinth Adventure
    • Sintrelya
  • Blog
    • Audio relaxation : In the Celestial Expanse
    • Tutorials
    • Blog Posts
  • Contact
    • Contact us
    • The Oniric Forge Newsletter
  • Log In
  • Register
Close Menu

AFSGL

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
AFSG in-app Sequencer

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

Recent posts

  • Love2D dev : Create, edit, build and run Love2D applications with Sublime Text 3 (macOS)
  • WordPress : Add links to the admin bar
  • Video and Audio fade in / fade out
  • Combine images into a strip
  • Binaural beats

Oniric Forge Newsletter

Categories

  • Blog
    • Blog Posts
      • Binaural beats
    • Tutorials
      • Love2D
      • Media processing
      • WordPress

Tags

The Joy of Coding

Terms

  • Privacy Policy
  • Terms and Conditions

Links

  • The Oniric Forge Newsletter Archives
  • Apps
    • Injection Planning
    • Audio Frequency Signal Generator
    • Tiny Labyrinth Adventure
    • Sintrelya
  • Frequency List
  • Audio Relaxation : In the Celestial Expanse
  • Tutorials
  • Blog Posts

Contact

  • Contact Us
  • The Oniric Forge Newsletter

Follow Us

Mobile App WordPress Theme Copyright © 2025 oniricforge.com

Manage Cookie Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
View preferences
{title} {title} {title}

Terms and Conditions