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 PACKETSIZE = 64;
|
||||
function make_packets_bin(PACKETSIZE) {
|
||||
let data = [];
|
||||
for(let t=0;t<PACKETSIZE;t++) data.push(t);
|
||||
|
||||
let data = [];
|
||||
for(let t=0;t<PACKETSIZE;t++) data.push(t);
|
||||
let packet = [
|
||||
0xff, 0xff, 0xff, 0xff, 0xfe, // header plus start bit
|
||||
...data, // the actual data block
|
||||
0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, // filler
|
||||
]
|
||||
|
||||
let packet = [
|
||||
0xff, 0xff, 0xff, 0xff, 0xfe, // header plus start bit
|
||||
...data, // the actual data block
|
||||
0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, // filler
|
||||
]
|
||||
let packets = [];
|
||||
|
||||
let packets = [];
|
||||
for(let t=0;t<1000;t++) {
|
||||
packets = [...packets, ...packet];
|
||||
}
|
||||
|
||||
for(let t=0;t<1000;t++) {
|
||||
packets = [...packets, ...packet];
|
||||
let file = new Uint8Array(packets);
|
||||
|
||||
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 ../../../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