Program that sends tone to your beepers

.clang-format .clang-format: Create 5 months ago
LICENSE Initial commit 5 months ago
README.md README.md: Add happy tune 5 months ago
evtone.c evtone: Bump to 1.4 5 months ago
meson.build meson.build: Install evtone 5 months ago
README.md

What's this?

evtone is a command-line program that plays tones on any beeper device on Linux, such as your PC speaker or the pwm-beeper module.

Unlike 'beep' or similar tools, evtone only supports outputting SND_TONE events to devices you'll find in /dev/input. No attempt to play tones through the connected terminal or to single tone hardware is supported.

How do I use it?

Copy and pasted from evtone --help:

Usage: evtone [OPTION...] TONE [TONE...]
TONE is of the format HZ:MILLISECONDS
Up to 256 TONEs may be specified at once.

  -d, --dry-run              Print what the program will do
  -D, --device=FILE          /dev/input device to use to play tones
                             If not supplied the device will be guessed
  -?, --help                 Give this help list
      --usage                Give a short usage message
  -V, --version              Print program version

Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.

Examples:
  "evtone 440:1500" plays a tone of 440Hz for 1500 milliseconds.
  "evtone 440:1500 300:10" plays a 440Hz tone for 1500 milliseconds
    followed by a 300Hz tone for 10 milliseconds
  "evtone -d 440:1500 300:10" will print what the program will do
    instead of actually doing it
  "evtone -D /dev/input/event2 440:1000" will play a 440Hz tone for
    1000 milliseconds using the /dev/input/event2 device

Here's some example happy beeps you can try:

$ evtone 220:100 275:100 330:100 440:100 550:100 660:100 880:200

System requirements

You need the following to build and run this software:

  • Linux kernel
  • glibc
  • GCC (for building only)
  • Meson (for building only)

To build and run with Meson use these commands:

$ meson setup build
$ cd build
$ ninja
$ ./evtone

If you really dislike Meson, you can build with just GCC like this:

$ gcc evtone.c -o evtone
$ ./evtone

TODO

There's always new stuff to add to software. Some future ideas for evtone:

  • Find bugs (I'm sure they're there!)

License

evtone is licensed under the MIT license.