Skip to main content
FW version: Stable

Beeping

The controller can generate sounds by vibrating its motor coils. It can play melodies using its onboard synthesizer.

Synthesizer features (ESCx)

  • The sound generation produces best results with PMSM motors (with permanent magnets).
  • The sequence pattern was designed to minimize producing torque or movement, although this may sometimes happen (particularly during low notes).
  • By default, the driver will allow to generate sound only if the motor is standing still to prevent any unwanted torque generation.
  • On request, siliXcon can enable run-time generation (modulation of sound onto the active motor control) for your application.
  • If the motor is back-driven during a melody playback, the sound generation will stop until the motor becomes still again.
  • The generation is not dependent on the knowledge of the rotor position and works even when sensor malfunction is present.
  • The volume is derated by protections and limiters.

Sequencing

info

This section is common for all siliXcon devices equipped with audio output.

While the application typically handles the sequencing, you can test sounds or create your own melodies using the following commands. These melodies can later be incorporated into your application.

beep [note] [length] [modulation]

  • note - note (same notes as used in play)
  • length - default value is 100 time quanta (if not specified)
  • modulation - the modulation parameter (optional)

Notes

Note values range from 1 to 253.

Basic notes:

NoteNote number
C146+0
C1x46+1
D146+2
D1x46+3
E146+4
F146+5
F1x46+6
G146+7
G1x46+8
A146+9
A1x46+10
H146+11
C246+13

Modulations

Amplitude modulation (exponential envelope):

Modulationnumber
DECAY 00
DECAY 116
DECAY 2 (default)32
DECAY 348
info

The high bits of the modulation affect frequency modulation. Feel free to experiment!

play [song]

Usage:

  • Three predefined songs are available. Play them using: play 0, play 1or play 2.
  • Play your custom song
  • play - (without an argument) will stop actual sequence.

How to create and play a custom song

You can create an array variable using YOS scripting:


# Create array variable for your sequence. This can store 10 commands for the synthesizer.
var song.20 uint8

# Fill-in the variable with the sequence. Each command consists of two bytes: length (in time quanta) and note number (do not put spaces between numbers).
set song 8,47,8,48,8,49,8,50

# Play the song!
play song

Set the modulation envelope (timbre)

Use the value 255 for length to indicate a modulation set command. The following value will be interpreted as a modulation set command.

set song 8,47,8,48,255,16,8,50
# Order: length1, note1, length2, note2, 255, modulation = DECAY2, length3, note3

The modulation setting persists until changed.

Change volume in song

Use the value 254 for length to indicate a volume command. The following value sets the volume (range: 0-255).

set song 8,47,8,48,254,128,8,50
# Order: length1, note1, length2, note2, 255, volume = 50%, length3, note3

The volume setting persists until changed.