ToneGenerator - Frequency tones with sine, sawtooth, triangle, square, and synthesized piano (organ-like) waves.

ToneGenerator
Generates tones with options for
sine, sawtooth, triangle, square
and synthesized piano (organ-like) waves.

GIF_20250217_211133_430


GenerateTone

Generates tones with options for sine, sawtooth, triangle, square, and synthesized piano (organ-like) waves.

  • trackId: Identifier.
  • waveType: (Sine, Sawtooth, Triangle, Square, Piano).
  • frequency: Pitch in Hertz.
  • duration: Pitch in seconds.
  • silenceDuration: Duration of silence between tones in seconds.
  • addSilence: Whether to add silence between tones.
  • amplitude: Amplitude of the tone.
  • fadeOut: Duration of the fade effect at the end of the tone in seconds.

StopAll

Stops all currently playing tones with a fade duration.

blocks (85)

  • fadeOutDuration: Duration of the fade effect in milliseconds.

StopById

Stops a specific tone by its id with a fade duration.

  • trackId: Identifier.
  • fadeOutDuration: Duration of the fade effect in milliseconds.

IsPlaying

Returns true if any tone is currently playing.

component_set_get (1)


PlayingStatusChanged

Fired when the playing status changes.


ToneStarted

Fired when a tone starts playing.

component_event (5)


ToneFinished

Fired when a tone finishes playing.

component_event (6)


v1.2 Oct 12, 2025.

ToneGenerator.aia (41.3 KB)

joejsanz.joedevtonegenerator.aix (14.5 KB)


JDK: 11
Minimum API Level: 21
Updated On: 2025-10-12T07:00:00Z

Built using: FAST-CLI v5.2.0-premium


Thanks.

9 Likes

thank you, now i can use this for my app

1 Like

Is it possible to add an event/property isPlaying (id) ?

Update v1.1

2 Likes

Can this be done by id ?

Example: a sound generated by either touch or drag on the canvas (piano keys), but if touch starts the sound then drag does not (id 1), but could start the next sound(id 2) and then stop the previous sound (id 1)

1 Like

Update v1.2

It's done, at the beginning and end of each sound, events with the ids of each sound are triggered.

  • I updated the aia project so you can test the new events.
3 Likes

Many thanks, will test out and report back

1 Like

Thanks for your blocks. Vey helpful.
I made a litle app to simulate the sound of an electric variometer * with a simple slider.

  • Thats the instrument used in gliders (planes without an engine) to know if you are flying in an ascending or descending air mass, head up (without looking at the instrument panel).

ElectricVariometerSound.aia (32.6 KB)

1 Like

Thank you very much for sharing, the application you created is very good.