mirror of
https://github.com/nippur72/apple1-videocard-lib.git
synced 2024-06-08 13:29:33 +00:00
single tone wav generation for tape monitor
This commit is contained in:
parent
a8e97b5aa3
commit
bf27aadbf6
|
@ -1,24 +1,42 @@
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
|
||||||
const PACKETSIZE = 64;
|
function make_packets_bin(PACKETSIZE) {
|
||||||
|
let data = [];
|
||||||
|
for(let t=0;t<PACKETSIZE;t++) data.push(t);
|
||||||
|
|
||||||
let data = [];
|
let packet = [
|
||||||
for(let t=0;t<PACKETSIZE;t++) data.push(t);
|
0xff, 0xff, 0xff, 0xff, 0xfe, // header plus start bit
|
||||||
|
...data, // the actual data block
|
||||||
|
0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, // filler
|
||||||
|
]
|
||||||
|
|
||||||
let packet = [
|
let packets = [];
|
||||||
0xff, 0xff, 0xff, 0xff, 0xfe, // header plus start bit
|
|
||||||
...data, // the actual data block
|
|
||||||
0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, // filler
|
|
||||||
]
|
|
||||||
|
|
||||||
let packets = [];
|
for(let t=0;t<1000;t++) {
|
||||||
|
packets = [...packets, ...packet];
|
||||||
|
}
|
||||||
|
|
||||||
for(let t=0;t<1000;t++) {
|
let file = new Uint8Array(packets);
|
||||||
packets = [...packets, ...packet];
|
|
||||||
|
fs.writeFileSync(`packets_${PACKETSIZE}.bin`, file);
|
||||||
}
|
}
|
||||||
|
|
||||||
let file = new Uint8Array(packets);
|
make_packets_bin(32);
|
||||||
|
make_packets_bin(64);
|
||||||
|
make_packets_bin(128);
|
||||||
|
make_packets_bin(255);
|
||||||
|
|
||||||
|
function make_single_tone(data_byte) {
|
||||||
|
let data = [];
|
||||||
|
for(let t=0;t<128*1024;t++) data.push(data_byte);
|
||||||
|
|
||||||
|
let file = new Uint8Array(data);
|
||||||
|
|
||||||
|
fs.writeFileSync(`single_tone_${data_byte}.bin`, file);
|
||||||
|
}
|
||||||
|
|
||||||
|
make_single_tone(0);
|
||||||
|
make_single_tone(255);
|
||||||
|
|
||||||
fs.writeFileSync("packets.bin", file);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,2 +1,18 @@
|
||||||
call node mkpackets
|
call node mkpackets
|
||||||
call node ../../../tools/wavconv/prg2wav.js -i packets.bin -o packets -b 00
|
|
||||||
|
call node ../../../tools/wavconv/prg2wav.js -i packets_32.bin -o packets_32 -b 00
|
||||||
|
call node ../../../tools/wavconv/prg2wav.js -i packets_64.bin -o packets_64 -b 00
|
||||||
|
call node ../../../tools/wavconv/prg2wav.js -i packets_128.bin -o packets_128 -b 00
|
||||||
|
call node ../../../tools/wavconv/prg2wav.js -i packets_255.bin -o packets_255 -b 00
|
||||||
|
|
||||||
|
del packets_32.bin
|
||||||
|
del packets_64.bin
|
||||||
|
del packets_128.bin
|
||||||
|
del packets_255.bin
|
||||||
|
|
||||||
|
call node ../../../tools/wavconv/prg2wav.js -i single_tone_0.bin -o single_tone_0 -b 00
|
||||||
|
call node ../../../tools/wavconv/prg2wav.js -i single_tone_255.bin -o single_tone_255 -b 00
|
||||||
|
|
||||||
|
del single_tone_0.bin
|
||||||
|
del single_tone_255.bin
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user