Ronja Twibright Labs

Twibright VAC

VAC - Virtual Analog Cassette

 _______________________________________________________
(+)  _______________________________________________  (+)
|   / Last Day On Earth(UK)/Peter McCormick |       \   |
|  | Fear Of Falling | CC-BY-SA 4.0 International    |  |
|  | Indie rock, 2013                                |  |
|  | https://archive.org/details/LastDayOnEarthCC    |  |
|  |        _________________________________        |  |
|  |       /            _________            \       |  |
|  |      |  A " A     |         |     A " A  |      |  |
|  |      | (     )    |   | |   |    (     ) |      |  |
|  |      |  v , v     |_________|     v , v  |      |  |
|  | 70 μs \_________________________________/       |  |
|  |                                                 |  |
|  | VIRTUAL ANALOG CASSETTE        BY KAREL KULHAVÝ |  |
|  |_________________________________________________|  |
|            /             (+)             \            |
|           /        _             _        \           |
|          /   _    (_)           (_)    _   \          |
(+)_______/___(_)_______________________(_)___\_______(+)

1. Purpose

VAC records analog audio into a self-extracting C file using ASCII art. The resuting C file can be compiled and run to produce the same analog audio on the output only with additive noise of the analog recording.

This is neither dithering nor digital storage with high precision. This is a real analog audio.

1.0 Technical parameters

Distortion 0%
Noise Additive pseudorandom
SNR Configurable as linear amplitude ratio
0:1 -infinity dB
1:1 0 dB
2:1 6 dB
...
8464:1 80 dB
Noise Randomness Quality Marsaglia Xorshift* 64-bit with 32-bit seed expanded to 64 bits
Channels Mono or stereo
Output Bit Depth 32-bit LPCM
Input Bit Depth 16, 24 or 32 bit LPCM
Sample Rate 1 Hz to 4.294 967 295 GHz in 1 Hz steps

2. Requirements

Download

Current version is 1.

vac_1.tar.gz from Internet Archive archive.org is a secure download over https.

SHA256 sum

d95d9e22b32f917d39c9359f9149da54e17f2978c79812666644677a2f66e883  vac_1.tar.gz

SHA1 sum

b3b8231762a270dd0741c067a5faf22ee1afb75d  vac_1.tar.gz

4. Installing

5. Running

5.1 Applying broacast modulation processor before recording

You may want to make the recording sound like AM or FM radio by a sophisticated boosting of the instantaneous volume in individual requency bands to a full level. Such audio is easier to listen to in an everyday environment with noise and sounds bolder and radio-like or TV-like.

The _speech scripts are for spoken word where we don't want the background noises of the room to come up audibly.

Requirement: SoX installed

Quality Max. audio freq. Sample rate Channels Ordinary Script Speech Script
Standard AM 5 512.5 Hz 11 025 Hz mono bcast_am.sh bcast_am_speech.sh
Wide AM 11 025 Hz 22 050 Hz mono bcast_wam.sh bcast_wam_speech.sh
FM 22 050 Hz 44 100 Hz stereo bcast_fm.sh bcast_fm_speech.sh

This example command creates output file my_am.wav:

bcast_am.sh my.wav

6. Adjust ASCII-art font brigtness calibration

The proper brightness of the ASCII-art characters depends on the terminal font you use. The default is calibrated for DejaVu Sans Mono Book and if you use a different font you can keep it, the difference won't be big.

But if you want better looking ASCII-art on your terminal you may try:

6.1 Other ASCII-art font orderings (from included .tsv file)

Some other ASCII-art ordering can be used by replacing DejaVuSansMono-85x94.tsv in Makefile with another .tsv file.

6.2 More ASCII-art font orderings (make your own .tsv file for any font)

Install Fontforge and bdf2c https://github.com/pixelmatix/bdf2c

Load a vector font into Fontforge, example: fontforge /usr/share/fonts/opentype/dosis/Dosis-Light.otf

Element; Bitmap Strikes Available; put 4 times the point size you use on your terminal into "Point sizes on a 100 dpi screen" (to simulate antialiasing 4x4); OK

Element; Regenerate Bitmap Glyhps; OK

File; Generate Fonts; left: No Outline Font, right: BDF; filename:my.bdf; Generate

bdf2c -c | grep "^#define" > my.h

bdf2c -b < my.bdf | sed -nE '/^#include/d;/__font_widths__/q;p' >> my.h

bdf2c -b < my.bdf | grep .Height | sed -E 's/\.Width/width/;s/\.Height/height/;s/,[ \t]*$/;/;s/^[ \t]*/unsigned /' >> my.h

bdf2c -b < my.bdf | sed -nE '/__font_index__\[\]/,+1{s/,/;/;s/^[ \t]*/unsigned start_char=/;p}'|tail -1 >> my.h

Replace DejaVuSansMono-85x94.h in count.c with the path to my.h

make count

./count > my.tsv

Now you can use my.tsv like the other .tsv files in section 5.1 above.

7. Contact

Homepage: http://ronja.twibright.com/vac.php

Author contact: http://twibright.com/contact.php

8. Licence

VAC (Virtual Analog Cassette) is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

An expected information missing here?