Ticket #8610 (assigned enhancement)

Opened 6 years ago

Last modified 6 years ago

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
Action Needed: never set Verified: no
Deployments affected: Blocked By:
Blocking:

Description

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

Changed 6 years ago by douglas

  • status changed from new to assigned
  • owner set to douglas
  • component changed from not assigned to school server
  • milestone changed from Not Triaged to Future Release

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  http://www.johnath.com/beep/

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.

Changed 6 years ago by douglas

Current tunes for usbmount:

Start with a rising tone sequence:

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

End with a falling sequence:

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

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