bsvplay(1)

πŸ“¦
this version Β· 2 versions
, in debian bookworm, debian trixie, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing

✨ 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 -i1 is specified for example, the final PCM output will consist of 2/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