bsvplay(1)
β¨ bsvplay β convert BASICA music data to PCM β¨
okay bestie so this is bsvplay(1), part of the hxtools family, and it's literally the girl who takes ancient BASICA binary music data and turns it into linear 16-bit raw PCM. retro bops, unlocked π
πΈ SYNOPSIS πΈ
bsvplay [-i part] [-q part] [-r rate] [file...] | aplay -f dat -c 1
yes the pipe is part of the vibe. she converts, you play. team work makes the dream work π«Ά
π DESCRIPTION π
So here's the tea: bsvplay will convert BASICA binary music data to linear 16-bit raw PCM. Normally, you will be wanting to pipe it into a raw PCM player like aplay(1) to actually output it to a sound device. no cap.
Be sure to lower the volume beforehand to avoid nasty surprises that come with square waves. π fr fr, square waves do NOT play nice with your ears at full send.
By default, bsvplay will mix 1:1 square:sine waves to give a medium tone hardness. balanced. iconic. main character energy. π
Do note that the music data is embedded in BSV/EXE/COM files and needs to be manually located. It is usually very evident from a regular pattern in hexdumps. iykyk π
π OPTIONS π
-q partβ Part to mix square waves in (default:1.0). the square girlie of the mix π¦-i partβ Part to mix sine waves in (default:1.0). If-q2 -i1is specified for example, the final PCM output will consist of2/3*squarepcm + 1/3*sinpcm. the sine girlie, but make it math π-r rateβ PCM sample rate (default:48000 Hz). yes she's high-res, we love that for her β--pianomanβ Assume the input is Pianoman MUS. a whole different era bestie, respect it πΉ
π¦ FILE FORMAT π¦
The BASICA format is defined 6-byte tuples of divisor, duration and pause. like, three little uint16_t besties holding hands:
struct bsv_insn {
uint16_t divisor;
uint16_t duration; /* in ticks */
uint16_t af_pause; /* in ticks */
};
where divisor specifies the divisor value that it directly handed to the x86 PC speaker. it's giving direct hardware communication π§
The following formula holds:
frequency = 1193181 / divisor;
and that's the whole magic trick. periodt. β¨
π SEE ALSO π
sign-off moment π this page is from the hxtools collection, dated 2008-02-06, and it says bsvplay(1) at the bottom like a little name tag. mwah. go make some beeps bestie π π₯ πΈ
π¦ where this page comes from
- debian bookworm: hxtools 20221119-1 Β· MIT
- debian trixie: hxtools 20231224-2+b2 Β· MIT
- opensuse-leap 16.0: hxtools-man 20231224-bp160.1.12 Β· GPL-2.0-or-later AND WTFPL
- ubuntu jammy: hxtools 20211204-1 Β· GPL-2.0-or-later OR GPL-2+3 OR WTFPL
- ubuntu noble: hxtools 20231224-2ubuntu1 Β· MIT
- ubuntu questing: hxtools 20231224-2ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms