Compare commits
No commits in common. "f7df0999d713abd417f68b53f24ba4ae2aea8bc1" and "a4196851217ead3f94e0c1ef00142a51b2ebbf3d" have entirely different histories.
f7df0999d7
...
a419685121
12 changed files with 24 additions and 422 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -13,8 +13,3 @@ chickens.wav
|
||||||
chickens.s
|
chickens.s
|
||||||
dubstep.wav
|
dubstep.wav
|
||||||
dubstep.wav.*
|
dubstep.wav.*
|
||||||
video-rickroll/frames
|
|
||||||
video-doom/frames
|
|
||||||
video-cat/frames
|
|
||||||
video-bulk/frames
|
|
||||||
video/frames
|
|
||||||
|
|
48
Makefile
48
Makefile
|
@ -1,44 +1,21 @@
|
||||||
all : rickroll.xex
|
all : sample0.xex \
|
||||||
|
sample1.xex sample2.xex sample3.xex sample4.xex sample5.xex sample6.xex \
|
||||||
|
fruit.xex mapclock.xex sailboat.xex sunset.xex train404.xex \
|
||||||
|
potato.xex selfie.xex kitty.xex meme.xex
|
||||||
|
|
||||||
# sample5.s from sample5.jpg
|
# sample5.s from sample5.jpg
|
||||||
|
|
||||||
# reminder: $< is input
|
# reminder: $< is input
|
||||||
# $@ is output
|
# $@ is output
|
||||||
|
|
||||||
%.s : %.jpg dither-image.js gif.sh mp4.sh
|
%.s : %.jpg dither-image.js
|
||||||
node dither-image.js $< $@
|
node dither-image.js $< $@
|
||||||
|
|
||||||
chickens.s : chickens.wav pack-wav.js
|
|
||||||
node pack-wav.js $< $@
|
|
||||||
|
|
||||||
dubstep.wav.s : dubstep.wav pack-wav.js
|
|
||||||
node pack-wav.js $< $@
|
|
||||||
|
|
||||||
dubstep.wav : Dubstep_Loop_by_WinnieTheMoog.ogg
|
|
||||||
ffmpeg -i "Dubstep_Loop_by_WinnieTheMoog.ogg" \
|
|
||||||
-t 2.0 \
|
|
||||||
-acodec pcm_u8 \
|
|
||||||
-ac 1 \
|
|
||||||
-ar 15704 \
|
|
||||||
-y $@
|
|
||||||
|
|
||||||
never-gonna-give-you-up.wav.s : never-gonna-give-you-up.wav pack-wav.js
|
|
||||||
node pack-wav.js $< $@
|
|
||||||
|
|
||||||
never-gonna-give-you-up.wav : never-gonna-give-you-up.mp4
|
|
||||||
ffmpeg -i "never-gonna-give-you-up.mp4" \
|
|
||||||
-vn \
|
|
||||||
-t 2.0 \
|
|
||||||
-acodec pcm_u8 \
|
|
||||||
-ac 1 \
|
|
||||||
-ar 15704 \
|
|
||||||
-y $@
|
|
||||||
|
|
||||||
%.o : %.s
|
%.o : %.s
|
||||||
ca65 -v -t atari -o $@ $<
|
ca65 -v -t atari -o $@ $<
|
||||||
|
|
||||||
%.xex : %.o dither4.o never-gonna-give-you-up.wav.o atari-asm-xex.cfg
|
%.xex : %.o dither4.o atari-asm-xex.cfg
|
||||||
ld65 -v -C ./atari-asm-xex.cfg -o $@ dither4.o never-gonna-give-you-up.wav.o $<
|
ld65 -v -C ./atari-asm-xex.cfg -o $@ dither4.o $<
|
||||||
|
|
||||||
clean :
|
clean :
|
||||||
rm -f *.o
|
rm -f *.o
|
||||||
|
@ -47,14 +24,3 @@ clean :
|
||||||
rm -f fruit.s mapclock.s sailboat.s sunset.s train404.s
|
rm -f fruit.s mapclock.s sailboat.s sunset.s train404.s
|
||||||
rm -f potato.s selfie.s kitty.s meme.s
|
rm -f potato.s selfie.s kitty.s meme.s
|
||||||
rm -f *.xex
|
rm -f *.xex
|
||||||
rm -f chickens.s
|
|
||||||
rm -f chickens.o
|
|
||||||
rm -f dubstep.wav
|
|
||||||
rm -f dubstep.wav.[so]
|
|
||||||
rm -f never-gonna-give-you-up.wav
|
|
||||||
rm -f never-gonna-give-you-up.wav.[so]
|
|
||||||
|
|
||||||
test : all
|
|
||||||
atari800 rickroll.xex
|
|
||||||
|
|
||||||
.dummy: clean test sample0.s sample1.s sample2.s sample3.s sample4.s sample5.s sample6.s chickens.s rickroll.s
|
|
||||||
|
|
|
@ -1067,7 +1067,7 @@ async function saveImage(width, height, lines, dest) {
|
||||||
resolve(image);
|
resolve(image);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
await image.resize(Math.round(width2 * 2), height * 2);
|
await image.resize(Math.round(width2 * 2 / 1.2), height * 2);
|
||||||
await image.writeAsync(dest);
|
await image.writeAsync(dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
98
dither4.s
98
dither4.s
|
@ -26,7 +26,6 @@ sample_ptrl = $84
|
||||||
sample_ptrh = $85
|
sample_ptrh = $85
|
||||||
sample_ptr = sample_ptrl
|
sample_ptr = sample_ptrl
|
||||||
scanline = $86
|
scanline = $86
|
||||||
audiotemp = $87
|
|
||||||
frame_counter = $89
|
frame_counter = $89
|
||||||
|
|
||||||
;height = 160
|
;height = 160
|
||||||
|
@ -40,9 +39,6 @@ scanline_max = (lines_per_frame - scanline_offset) / 2
|
||||||
|
|
||||||
.data
|
.data
|
||||||
|
|
||||||
.import audio_samples
|
|
||||||
.import audio_samples_end
|
|
||||||
|
|
||||||
.import frame1_top
|
.import frame1_top
|
||||||
.import frame1_bottom
|
.import frame1_bottom
|
||||||
.import frame1_palette1_even
|
.import frame1_palette1_even
|
||||||
|
@ -53,41 +49,11 @@ scanline_max = (lines_per_frame - scanline_offset) / 2
|
||||||
.import frame1_palette3_odd
|
.import frame1_palette3_odd
|
||||||
.import displaylist
|
.import displaylist
|
||||||
|
|
||||||
audio_high_byte:
|
|
||||||
.scope
|
|
||||||
.macro byteseq val
|
|
||||||
.repeat 16
|
|
||||||
.byte val | $10
|
|
||||||
.endrep
|
|
||||||
.endmacro
|
|
||||||
byteseq $0
|
|
||||||
byteseq $1
|
|
||||||
byteseq $2
|
|
||||||
byteseq $3
|
|
||||||
byteseq $4
|
|
||||||
byteseq $5
|
|
||||||
byteseq $7
|
|
||||||
byteseq $8
|
|
||||||
byteseq $9
|
|
||||||
byteseq $a
|
|
||||||
byteseq $b
|
|
||||||
byteseq $c
|
|
||||||
byteseq $d
|
|
||||||
byteseq $e
|
|
||||||
byteseq $f
|
|
||||||
.endscope
|
|
||||||
|
|
||||||
.code
|
.code
|
||||||
|
|
||||||
.export start
|
.export start
|
||||||
|
|
||||||
.proc start
|
.proc start
|
||||||
; Set up the audio sample buffer
|
|
||||||
lda #.lobyte(audio_samples)
|
|
||||||
sta sample_ptrl
|
|
||||||
lda #.hibyte(audio_samples)
|
|
||||||
sta sample_ptrh
|
|
||||||
|
|
||||||
; Disable display DMA
|
; Disable display DMA
|
||||||
lda #$00
|
lda #$00
|
||||||
sta DMACTL
|
sta DMACTL
|
||||||
|
@ -132,6 +98,8 @@ wait_loop:
|
||||||
.macro inner_scanline frame_offset, line_offset
|
.macro inner_scanline frame_offset, line_offset
|
||||||
; Y should be VCOUNT at entry
|
; Y should be VCOUNT at entry
|
||||||
; it'll fire on unused lines, but harmlessly
|
; it'll fire on unused lines, but harmlessly
|
||||||
|
;ldy scanline ; 3 cyc
|
||||||
|
;inc scanline ; 5 cyc
|
||||||
|
|
||||||
; 23-26 cycles before break
|
; 23-26 cycles before break
|
||||||
; Leisurely memory fetches
|
; Leisurely memory fetches
|
||||||
|
@ -141,7 +109,6 @@ wait_loop:
|
||||||
lda frame1_palette3_even + frame_offset + line_offset - scanline_offset / 2,y ; 4/5
|
lda frame1_palette3_even + frame_offset + line_offset - scanline_offset / 2,y ; 4/5
|
||||||
tay ; 2
|
tay ; 2
|
||||||
pla ; 3
|
pla ; 3
|
||||||
|
|
||||||
; Wait for horizontal blank
|
; Wait for horizontal blank
|
||||||
sta WSYNC ; 4
|
sta WSYNC ; 4
|
||||||
|
|
||||||
|
@ -152,59 +119,6 @@ wait_loop:
|
||||||
sty COLPF2 ; 4
|
sty COLPF2 ; 4
|
||||||
.endmacro
|
.endmacro
|
||||||
|
|
||||||
.macro audio_play_raw
|
|
||||||
;ldy VCOUNT ; set on entry
|
|
||||||
lda (sample_ptr),y ; 5/6 cyc
|
|
||||||
sta AUDC1 ; 4 cyc
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
.macro audio_prep
|
|
||||||
; Y is VCOUNT at entry
|
|
||||||
lda (sample_ptr),y ; 5/6 cyc
|
|
||||||
sta audiotemp ; 3 cyc
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
; call with A pre-loaded to audiotemp
|
|
||||||
.macro audio_play_lo
|
|
||||||
;lda audiotemp ; 3 cyc
|
|
||||||
and #$0f ; 2 cyc
|
|
||||||
ora #$10 ; 2 cyc
|
|
||||||
sta AUDC1 ; 4 cyc
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
; clobbers Y
|
|
||||||
.macro audio_play_hi ; 12 cycles
|
|
||||||
ldy audiotemp ; 3 cyc
|
|
||||||
lda audio_high_byte,y ; 5 cyc
|
|
||||||
sta AUDC1 ; 4 cyc
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
.macro audio_inc
|
|
||||||
; 22 cycles
|
|
||||||
lda sample_ptrl ; 3 cyc
|
|
||||||
clc ; 2 cyc
|
|
||||||
adc #131 ; 2 cyc
|
|
||||||
sta sample_ptrl ; 3 cyc
|
|
||||||
lda sample_ptrh ; 3 cyc
|
|
||||||
adc #0 ; 2 cyc
|
|
||||||
sta sample_ptrh ; 3 cyc
|
|
||||||
cmp #.hibyte(audio_samples_end) ; 2 cyc
|
|
||||||
bmi audio_cont ; 2 cyc
|
|
||||||
|
|
||||||
sta WSYNC
|
|
||||||
|
|
||||||
; 10 cycles, optional
|
|
||||||
lda #.lobyte(audio_samples) ; 2
|
|
||||||
sta sample_ptrl ; 3
|
|
||||||
lda #.hibyte(audio_samples) ; 2
|
|
||||||
sta sample_ptrh ; 3
|
|
||||||
|
|
||||||
sta WSYNC
|
|
||||||
ldy VCOUNT ; 4 cycles
|
|
||||||
|
|
||||||
audio_cont:
|
|
||||||
.endmacro
|
|
||||||
|
|
||||||
.macro run_frame frame_offset
|
.macro run_frame frame_offset
|
||||||
.scope
|
.scope
|
||||||
; each scanline is 228 color clocks
|
; each scanline is 228 color clocks
|
||||||
|
@ -215,21 +129,13 @@ wait_loop:
|
||||||
sty scanline ; 3 cycles
|
sty scanline ; 3 cycles
|
||||||
inner_scanline frame_offset, 0 ; 23-26 cycles before break, 12 cycles after
|
inner_scanline frame_offset, 0 ; 23-26 cycles before break, 12 cycles after
|
||||||
|
|
||||||
ldy scanline ; 3 cycles
|
|
||||||
audio_prep
|
|
||||||
audio_play_lo
|
|
||||||
|
|
||||||
ldy scanline ; 3 cycles
|
ldy scanline ; 3 cycles
|
||||||
inner_scanline frame_offset, 128 ; 23-26 cycles before break, 12 cycles after
|
inner_scanline frame_offset, 128 ; 23-26 cycles before break, 12 cycles after
|
||||||
|
|
||||||
audio_play_hi
|
|
||||||
|
|
||||||
; pair cleanup: 6 cycles
|
; pair cleanup: 6 cycles
|
||||||
ldy VCOUNT ; 4 cycles
|
ldy VCOUNT ; 4 cycles
|
||||||
bne each_scanline_pair ; 2 cycles
|
bne each_scanline_pair ; 2 cycles
|
||||||
|
|
||||||
audio_inc ; 22-32 cycles
|
|
||||||
|
|
||||||
; frame cleanup: 11 cycles
|
; frame cleanup: 11 cycles
|
||||||
lda frame_counter ; 3 cycles
|
lda frame_counter ; 3 cycles
|
||||||
eor #1 ; 2 cycles
|
eor #1 ; 2 cycles
|
||||||
|
|
Binary file not shown.
31
pack-wav.js
31
pack-wav.js
|
@ -14,44 +14,31 @@ function byte2byte(arr) {
|
||||||
return lines.join('\n');
|
return lines.join('\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
class Dither {
|
function to4bit(val8) {
|
||||||
constructor() {
|
let val = (val8 + 7) >> 4;
|
||||||
this.err = 0;
|
if (val > 15) {
|
||||||
}
|
return 15;
|
||||||
|
|
||||||
to4bit(val8) {
|
|
||||||
let val = (val8 / 255) - this.err;
|
|
||||||
if (val < 0) {
|
|
||||||
val = 0;
|
|
||||||
}
|
|
||||||
if (val > 1) {
|
|
||||||
val = 1;
|
|
||||||
}
|
|
||||||
let val4 = Math.round(val * 15);
|
|
||||||
let dithered = (val4 / 15);
|
|
||||||
this.err = (dithered - val);
|
|
||||||
return val4;
|
|
||||||
}
|
}
|
||||||
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
function pack(audio) {
|
function pack(audio) {
|
||||||
let packed = [];
|
let packed = [];
|
||||||
let dither = new Dither();
|
/*
|
||||||
for (let i = 0; i < audio.length; i += 2) {
|
for (let i = 0; i < audio.length; i += 2) {
|
||||||
// little-endian 4-bit samples
|
// little-endian 4-bit samples
|
||||||
let low = dither.to4bit(audio[i]);
|
let low = to4bit(audio[i]);
|
||||||
let high = dither.to4bit(audio[i + 1]);
|
let high = to4bit(audio[i + 1]);
|
||||||
let byte = low | (high << 4);
|
let byte = low | (high << 4);
|
||||||
packed.push(byte);
|
packed.push(byte);
|
||||||
}
|
}
|
||||||
/*
|
*/
|
||||||
// raw push bytes
|
// raw push bytes
|
||||||
for (let i = 0; i < audio.length; i += 2) {
|
for (let i = 0; i < audio.length; i += 2) {
|
||||||
let val = to4bit(audio[i]);
|
let val = to4bit(audio[i]);
|
||||||
let byte = val | 0x10;
|
let byte = val | 0x10;
|
||||||
packed.push(byte);
|
packed.push(byte);
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
return packed;
|
return packed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
217
package-lock.json
generated
217
package-lock.json
generated
|
@ -6,7 +6,6 @@
|
||||||
"": {
|
"": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"jimp": "^0.16.2",
|
"jimp": "^0.16.2",
|
||||||
"wav": "^1.0.2",
|
|
||||||
"wavefile": "^11.0.0"
|
"wavefile": "^11.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@ -709,22 +708,6 @@
|
||||||
"ieee754": "^1.1.13"
|
"ieee754": "^1.1.13"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/buffer-alloc": {
|
|
||||||
"version": "1.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz",
|
|
||||||
"integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"buffer-alloc-unsafe": "^1.1.0",
|
|
||||||
"buffer-fill": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/buffer-alloc-unsafe": {
|
|
||||||
"version": "1.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz",
|
|
||||||
"integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/buffer-equal": {
|
"node_modules/buffer-equal": {
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-0.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-0.0.1.tgz",
|
||||||
|
@ -733,18 +716,6 @@
|
||||||
"node": ">=0.4.0"
|
"node": ">=0.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/buffer-fill": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz",
|
|
||||||
"integrity": "sha512-T7zexNBwiiaCOGDg9xNX9PBmjrubblRkENuptryuI64URkXDFum9il/JGL8Lm8wYfAXpredVXXZz7eMHilimiQ==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/buffer-from": {
|
|
||||||
"version": "1.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
|
|
||||||
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/callsites": {
|
"node_modules/callsites": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
||||||
|
@ -794,12 +765,6 @@
|
||||||
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
|
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/core-util-is": {
|
|
||||||
"version": "1.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
|
|
||||||
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/cross-spawn": {
|
"node_modules/cross-spawn": {
|
||||||
"version": "7.0.3",
|
"version": "7.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||||
|
@ -1251,7 +1216,8 @@
|
||||||
"node_modules/inherits": {
|
"node_modules/inherits": {
|
||||||
"version": "2.0.4",
|
"version": "2.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||||
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/is-extglob": {
|
"node_modules/is-extglob": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
|
@ -1288,12 +1254,6 @@
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/isarray": {
|
|
||||||
"version": "0.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
|
|
||||||
"integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/isexe": {
|
"node_modules/isexe": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||||
|
@ -1661,18 +1621,6 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/readable-stream": {
|
|
||||||
"version": "1.1.14",
|
|
||||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
|
|
||||||
"integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"core-util-is": "~1.0.0",
|
|
||||||
"inherits": "~2.0.1",
|
|
||||||
"isarray": "0.0.1",
|
|
||||||
"string_decoder": "~0.10.x"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/regenerator-runtime": {
|
"node_modules/regenerator-runtime": {
|
||||||
"version": "0.13.11",
|
"version": "0.13.11",
|
||||||
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz",
|
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz",
|
||||||
|
@ -1761,36 +1709,6 @@
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/stream-parser": {
|
|
||||||
"version": "0.3.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/stream-parser/-/stream-parser-0.3.1.tgz",
|
|
||||||
"integrity": "sha512-bJ/HgKq41nlKvlhccD5kaCr/P+Hu0wPNKPJOH7en+YrJu/9EgqUF+88w5Jb6KNcjOFMhfX4B2asfeAtIGuHObQ==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"debug": "2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/stream-parser/node_modules/debug": {
|
|
||||||
"version": "2.6.9",
|
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
|
||||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"ms": "2.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/stream-parser/node_modules/ms": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/string_decoder": {
|
|
||||||
"version": "0.10.31",
|
|
||||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
|
|
||||||
"integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/strip-ansi": {
|
"node_modules/strip-ansi": {
|
||||||
"version": "6.0.1",
|
"version": "6.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||||
|
@ -1887,34 +1805,6 @@
|
||||||
"pako": "^1.0.5"
|
"pako": "^1.0.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/wav": {
|
|
||||||
"version": "1.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/wav/-/wav-1.0.2.tgz",
|
|
||||||
"integrity": "sha512-viHtz3cDd/Tcr/HbNqzQCofKdF6kWUymH9LGDdskfWFoIy/HJ+RTihgjEcHfnsy1PO4e9B+y4HwgTwMrByquhg==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"buffer-alloc": "^1.1.0",
|
|
||||||
"buffer-from": "^1.0.0",
|
|
||||||
"debug": "^2.2.0",
|
|
||||||
"readable-stream": "^1.1.14",
|
|
||||||
"stream-parser": "^0.3.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/wav/node_modules/debug": {
|
|
||||||
"version": "2.6.9",
|
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
|
||||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"ms": "2.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/wav/node_modules/ms": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/wavefile": {
|
"node_modules/wavefile": {
|
||||||
"version": "11.0.0",
|
"version": "11.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/wavefile/-/wavefile-11.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/wavefile/-/wavefile-11.0.0.tgz",
|
||||||
|
@ -2521,35 +2411,11 @@
|
||||||
"ieee754": "^1.1.13"
|
"ieee754": "^1.1.13"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"buffer-alloc": {
|
|
||||||
"version": "1.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz",
|
|
||||||
"integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==",
|
|
||||||
"requires": {
|
|
||||||
"buffer-alloc-unsafe": "^1.1.0",
|
|
||||||
"buffer-fill": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"buffer-alloc-unsafe": {
|
|
||||||
"version": "1.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz",
|
|
||||||
"integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg=="
|
|
||||||
},
|
|
||||||
"buffer-equal": {
|
"buffer-equal": {
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-0.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-0.0.1.tgz",
|
||||||
"integrity": "sha512-RgSV6InVQ9ODPdLWJ5UAqBqJBOg370Nz6ZQtRzpt6nUjc8v0St97uJ4PYC6NztqIScrAXafKM3mZPMygSe1ggA=="
|
"integrity": "sha512-RgSV6InVQ9ODPdLWJ5UAqBqJBOg370Nz6ZQtRzpt6nUjc8v0St97uJ4PYC6NztqIScrAXafKM3mZPMygSe1ggA=="
|
||||||
},
|
},
|
||||||
"buffer-fill": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz",
|
|
||||||
"integrity": "sha512-T7zexNBwiiaCOGDg9xNX9PBmjrubblRkENuptryuI64URkXDFum9il/JGL8Lm8wYfAXpredVXXZz7eMHilimiQ=="
|
|
||||||
},
|
|
||||||
"buffer-from": {
|
|
||||||
"version": "1.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
|
|
||||||
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="
|
|
||||||
},
|
|
||||||
"callsites": {
|
"callsites": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
||||||
|
@ -2587,11 +2453,6 @@
|
||||||
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
|
"integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"core-util-is": {
|
|
||||||
"version": "1.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
|
|
||||||
"integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="
|
|
||||||
},
|
|
||||||
"cross-spawn": {
|
"cross-spawn": {
|
||||||
"version": "7.0.3",
|
"version": "7.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
|
||||||
|
@ -2931,7 +2792,8 @@
|
||||||
"inherits": {
|
"inherits": {
|
||||||
"version": "2.0.4",
|
"version": "2.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
|
||||||
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
|
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
|
||||||
|
"dev": true
|
||||||
},
|
},
|
||||||
"is-extglob": {
|
"is-extglob": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
|
@ -2959,11 +2821,6 @@
|
||||||
"integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==",
|
"integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"isarray": {
|
|
||||||
"version": "0.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
|
|
||||||
"integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ=="
|
|
||||||
},
|
|
||||||
"isexe": {
|
"isexe": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
|
||||||
|
@ -3244,17 +3101,6 @@
|
||||||
"integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
|
"integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"readable-stream": {
|
|
||||||
"version": "1.1.14",
|
|
||||||
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
|
|
||||||
"integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==",
|
|
||||||
"requires": {
|
|
||||||
"core-util-is": "~1.0.0",
|
|
||||||
"inherits": "~2.0.1",
|
|
||||||
"isarray": "0.0.1",
|
|
||||||
"string_decoder": "~0.10.x"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"regenerator-runtime": {
|
"regenerator-runtime": {
|
||||||
"version": "0.13.11",
|
"version": "0.13.11",
|
||||||
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz",
|
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz",
|
||||||
|
@ -3310,34 +3156,6 @@
|
||||||
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
|
"integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"stream-parser": {
|
|
||||||
"version": "0.3.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/stream-parser/-/stream-parser-0.3.1.tgz",
|
|
||||||
"integrity": "sha512-bJ/HgKq41nlKvlhccD5kaCr/P+Hu0wPNKPJOH7en+YrJu/9EgqUF+88w5Jb6KNcjOFMhfX4B2asfeAtIGuHObQ==",
|
|
||||||
"requires": {
|
|
||||||
"debug": "2"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"debug": {
|
|
||||||
"version": "2.6.9",
|
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
|
||||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
|
||||||
"requires": {
|
|
||||||
"ms": "2.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ms": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"string_decoder": {
|
|
||||||
"version": "0.10.31",
|
|
||||||
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
|
|
||||||
"integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ=="
|
|
||||||
},
|
|
||||||
"strip-ansi": {
|
"strip-ansi": {
|
||||||
"version": "6.0.1",
|
"version": "6.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz",
|
||||||
|
@ -3410,33 +3228,6 @@
|
||||||
"pako": "^1.0.5"
|
"pako": "^1.0.5"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"wav": {
|
|
||||||
"version": "1.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/wav/-/wav-1.0.2.tgz",
|
|
||||||
"integrity": "sha512-viHtz3cDd/Tcr/HbNqzQCofKdF6kWUymH9LGDdskfWFoIy/HJ+RTihgjEcHfnsy1PO4e9B+y4HwgTwMrByquhg==",
|
|
||||||
"requires": {
|
|
||||||
"buffer-alloc": "^1.1.0",
|
|
||||||
"buffer-from": "^1.0.0",
|
|
||||||
"debug": "^2.2.0",
|
|
||||||
"readable-stream": "^1.1.14",
|
|
||||||
"stream-parser": "^0.3.1"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"debug": {
|
|
||||||
"version": "2.6.9",
|
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
|
|
||||||
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
|
|
||||||
"requires": {
|
|
||||||
"ms": "2.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"ms": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"wavefile": {
|
"wavefile": {
|
||||||
"version": "11.0.0",
|
"version": "11.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/wavefile/-/wavefile-11.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/wavefile/-/wavefile-11.0.0.tgz",
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"jimp": "^0.16.2",
|
"jimp": "^0.16.2",
|
||||||
"wav": "^1.0.2",
|
|
||||||
"wavefile": "^11.0.0"
|
"wavefile": "^11.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|
BIN
rickroll.jpg
BIN
rickroll.jpg
Binary file not shown.
Before Width: | Height: | Size: 231 KiB |
|
@ -1,10 +0,0 @@
|
||||||
ffmpeg \
|
|
||||||
-r 60000/1001 \
|
|
||||||
-i 'frames/dither-%05d.png' \
|
|
||||||
-i 'rickroll-audio.wav' \
|
|
||||||
-ac 2 \
|
|
||||||
-ar 48000 \
|
|
||||||
-vf 'scale=534x384,setsar=1' \
|
|
||||||
-pix_fmt yuv420p \
|
|
||||||
-movflags +faststart \
|
|
||||||
-y rickroll-dither.mp4
|
|
|
@ -1,17 +0,0 @@
|
||||||
set -a
|
|
||||||
|
|
||||||
mkdir -p frames
|
|
||||||
|
|
||||||
ffmpeg \
|
|
||||||
-i rickroll.mp4 \
|
|
||||||
-vf 'scale=320:230,framerate=60000/1001' \
|
|
||||||
-an \
|
|
||||||
-y 'frames/rickroll-%05d.png'
|
|
||||||
|
|
||||||
ffmpeg \
|
|
||||||
-i rickroll.mp4 \
|
|
||||||
-vn \
|
|
||||||
-ac 1 \
|
|
||||||
-ar 15734 \
|
|
||||||
-acodec pcm_u8 \
|
|
||||||
-y 'rickroll-audio.wav'
|
|
|
@ -1,15 +0,0 @@
|
||||||
set -e
|
|
||||||
|
|
||||||
for frame in frames/rickroll-[0-9][0-9][0-9][0-9][0-9].png
|
|
||||||
do
|
|
||||||
n="${frame#frames/rickroll-}"
|
|
||||||
n="${n%.png}"
|
|
||||||
out="frames/dither-${n}"
|
|
||||||
last="${n:0-1}"
|
|
||||||
node ../dither-image.js "$frame" "$out" &
|
|
||||||
if (( last == 9 ))
|
|
||||||
then
|
|
||||||
wait
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
wait
|
|
Loading…
Reference in a new issue