Opened 6 years ago

Last modified 6 years ago

#8610 assigned enhancement

Theme music for the XS

Reported by: douglas Owned by: douglas
Priority: low Milestone: Future Release
Component: school server Version: not specified
Keywords: Cc: martin.langhoff
Blocked By: Blocking:
Deployments affected: Action Needed: never set
Verified: no


The school server needs to use sound to communicate.

For example, it automatically mounts USB drives and attempts various
communications, and this can take some time. Rather than have the
human guess how long to wait, the school server should play starting
and finishing ditties. It could indicate errors, and give musical
progress estimates.

Other ideas would be to have the server play an hourly tune that
indicated the disk was 95% full, or play a sad song when the network
is in poor shape.

These must be played through the PC speaker -- that annoying thing
that beeps at you in the console. It can be induced to play melodies
through escape codes. For instance, the following plays an A followed
by E followed by a higher A:

  echo -en '\033[10;440]\033[11;250]\007' > /dev/tty1
  # sleep because echo is instantaneous.
  sleep 0.3
  echo -en '\033[10;660]\033[11;250]\007' > /dev/tty1
  sleep 0.3
  echo -en '\033[10;880]\033[11;250]\007' > /dev/tty1
  sleep 0.3

  # silently return the beep to something reasonably normal.
  echo -en '\033[10;750]\033[11;300]' > /dev/tty1

So please, add candidate tunes below, either in this notation or with
a script that does the conversion.

Change History (2)

comment:1 Changed 6 years ago by douglas

  • Component changed from not assigned to school server
  • Milestone changed from Not Triaged to Future Release
  • Owner set to douglas
  • Status changed from new to assigned

Various notes:

According to man console_codes, the reset line can be

echo -en '\033[10]\033[11]' > /dev/tty1

Another way to beep is:

printf \\a

see also

And it turns out the maximum beep length is 1999 ms.

Some authors use /dev/console rather than /dev/tty1

It would be quite simple to convert simple music from the ABC format to shell.

comment:2 Changed 6 years ago by douglas

Current tunes for usbmount:

Start with a rising tone sequence:

# Fibonacci console beep
while (($hz1 < 16000)); do 
    echo -en '\033[10;'$hz1']\033[11;60]\007' > /dev/console
    sleep 0.1
    hz1=$(($hz1 + $hz2))

End with a falling sequence:

### Bells, descending
while (($hz > 50)); do 
    echo -en '\033[10;'$hz']\033[11;60]\007' > /dev/console
    sleep 0.11
    hz=$(($hz * 2 / 3))

#reset beep
echo -en '\033[10]\033[11]' > /dev/console
Note: See TracTickets for help on using tickets.