Music

Linux Candy: linuxwave – generate music from the entropy of Linux

Linux Candy is a series of articles covering interesting eye candy software. We only feature open source software in this series.

Some of the programs in this series are purely cosmetic, frivolous pieces of fun. Candy at their finest. But we also include some programs that aren’t purely decorative.

A diverse range of programs are included in this series. Programs such as eDEX-UI and Variety are actually highly practical programs. ASCIIQuarium has soothing and relaxing qualities for your desktop. Other programs included in this series (such as lolcat, cacafire) are included purely for their decorative qualities. And then there’s some really fun software that just raises a smile or two.

linuxwave is a small utility that’s designed to generate music from the entropy of Linux. What’s entropy? Think of entropy as the computer’s way of getting close to “randomness”.

Computers are incapable, by design, of generating truly random numbers, because no number produced by a mathematical operation is truly random. However, computers can get pretty close with entropy. A Linux machine collates “random numbers” by monitoring different events such as network activity, key-clicks etc. These are fed to the kernel entropy pool, which is used by /dev/random and /dev/urandom. Some programs need to use /dev/random or /dev/uradom as their source of entropy e.g. cryptography tools. linuxwave also uses entropy via /dev/urandom.

Installation

The developer provides binaries for Linux, macOS, and Windows. For Linux, there are binaries for different architectures too.

If you want to compile linuxwave, you’ll need Zig (a general-purpose programming language and toolchain). On an Ubuntu system, this can be installed using snap:

$ snap install zig --classic --beta

Clone the project’s GitHub repository and change into the newly created directory:

$ git clone https://github.com/orhun/linuxwave
$ cd linuxwave

Update the git submodules:

$ git submodule update --init --recursive

Now we can build the source.

$ zig build -Drelease-safe

In Operation

linuxwave is a CLI tool, so you’ll want to know the available options. They are listed by issuing the command $ linuxwave --help.

linuxwave - help

Let’s make a 20 second composition in the C major scale:

$ linuxwave -n 261.63 -d 20 -o music.wav

Here’s the generated wav file.

Summary

The generated wav files in themselves aren’t going to create a piece of music to challenge the greats of minimalism such as Philip Glass. But look what can be achieved with the software if you add some synths and drums, illustrated beautifully with the developer’s video.

Quite impressive to say the least.

The author of linuxwave, Orhun Parmaksız, is best known for kmon, a text-based tool to help you manage the Linux kernel modules and monitor the kernel activities.

Website: github.com/orhun/linuxwave
Support:
Developer: Orhun Parmaksız
License: MIT License

linuxwave is written in Zig. Learn Zig with our recommended free tutorials.


Complete list of articles in this series:

Linux Candy
ASCIIQuariumEmbrace marine life from the terminal with beautiful ASCII art
BobRossQuotesCollection of quotes from Bob Ross
BoxesCommand line ASCII boxes
BuohOnline strips comics reader
cacafireColor ASCII fire
catclockxclock with an enhanced cat mode
cbonsaiGenerate bonsai trees in the terminal
christmasfetchFestive cheer on the desktop
chucknorrisChuck Norris jokes in your terminal
cornyjokesCorny jokes for the terminal
CMatrixncurses program that simulates the display from “The Matrix”
ctreeA Christmas tree right on your terminal
eDEX-UISci-fi computer terminal emulator and system monitor
emojSimple tool that to find suitable emojis for pasting to your clipboard
EmoteModern popup emoji picker
EvolvotronInteractive generative art
FondoFind beautiful wallpapers from Unsplash
gtiTypo-based curio inspired by Steam Locomotive
HollywoodFill your console with Hollywood melodrama technobabble
linuxwaveGenerate music from the entropy of Linux
lolcatRainbows and unicorns
No More SecretsRecreates the data decryption effect from the Sneakers movie
nyancatTerminal-based Pop Tart Cat Animation
onekoAnimal chasing fun
pipes.shAnimated pipes terminal screensaver
ponysaycowsay reimplemention for ponies
projectMMusic visualizer originally based on Milkdrop
pscircleA different take on the venerable ps command
pyjokesOne line jokes for programmers
PywalGenerate color schemes on the fly
RelaxatorRelax to soothing sounds
Rusty AquariumMonitoring by visualization
Steam LocomotiveC program written in 295 lines. It's harmless fun
TernimalAnimated lifeform in the terminal
terminal-parrotParty parrot time
tetrisTile-matching puzzle video game in your terminal
VarietyWallpaper manager with many desktops and wallpaper sources
WallGenGenerate HQ poly wallpapers with a few arguments.
WallpaperDownloaderDownload, change, and manage wallpapers
xcowsayDisplays a cow on your desktop with message
XDecorationsAdd some festive cheer to your desktop
XScreenSaverFramework and collection of screensavers
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments