Create interactive sound tones in your web applications.


Based on:

https://github.com/escottalexander/simpleTones.js


Sample App:
https://visualneo.com/tutorials/neotones


Description


The neoTones plugin for VisualNEO Web enables sound generation through customizable tones and sounds. This plugin is well-suited for applications that benefit from audio feedback, musical notes, or simple sound effects, providing developers with precise control over sound parameters. Here’s an overview of its primary features:

Playing Predefined Sounds

The neoTonesPlaySound command plays a predefined sound by specifying its name, making it easy to add quick sound effects without detailed customization.

    • Command: neoTonesPlaySound
    • Syntax: neoTonesPlaySound soundname
      • soundname: The name of the predefined sound to play.

Example:

neoTonesPlaySound "bump"

This plays a sound effect named “bump”.

Playing Custom Tones

The neoTonesPlayTone command generates custom tones with specific parameters for tone, scale, waveform, and duration, giving flexibility to create a range of sounds.

    • Command: neoTonesPlayTone
    • Syntax: neoTonesPlayTone tone scale wavetype duration
      • tone: The musical note or tone (e.g., A4).
      • scale: Scale type (e.g., major or minor).
      • wavetype: Waveform shape (sine, square, triangle, sawtooth).
      • duration: Duration of the tone in seconds.

Example:

neoTonesPlayTone "C" "3" "sine" 1.5

This plays a C note in the third scale using a sine waveform for 1.5 seconds.

Playing a Custom Sound with Specific Frequencies

The neoTonesPlayCustomSound command allows for even more granular control by specifying exact frequencies and duration pairs.

    • Command: neoTonesPlayCustomSound
    • Syntax: neoTonesPlayCustomSound wavetype "frequencies"
      • wavetype: Waveform shape.
      • frequencies: Pairs of frequency and duration values (e.g., 440.5 523.6 for a 440 Hz tone for 0.5 seconds and a 523 Hz tone for 0.6 seconds).

Example:

neoTonesPlayCustomSound "sine" "440,.5,523,.6"

This plays two tones in sequence: a 440 Hz tone for 0.5 seconds followed by a 523 Hz tone for 0.6 seconds​.

Practical Applications

The neoTones plugin is ideal for:

    • Interactive Learning Tools: Teaching notes or scales in musical education apps.
    • Feedback Mechanisms: Providing sound feedback for user actions in games or apps.
    • Simple Sound Effects: Generating alert tones or notifications in web applications.

By offering both predefined sounds and custom tone generation, neoTones enhances VisualNEO Web applications with engaging and interactive sound features.

 

neoTonesPlaySound

Purpose:

Play a predefined sound

Category:

neoTones

Syntax:

neoTonesPlaySound soundname

 

soundname

Sound name

 

neoTonesPlayTone

Purpose:

Play a sound tone

Category:

neoTones

Syntax:

neoTonesPlayTone tone scale wavetype duration

 

tone

Tone

scale

Scale

wavetype

Wave type

duration

Duration in seconds

 

neoTonesPlayCustomSound

Purpose:

Play a custom sound

Category:

neoTones

Syntax:

neoTonesPlayCustomSound wavetype "frequencies"

 

wavetype

Wave type

frequencies

Frequency, duration pairs (ie: 440,.5,200,.6)

Created with the Personal Edition of HelpNDoc: Effortlessly Publish Your Word Document as an eBook