Shazoo & Elyssa
Hey Shazoo, I’ve been hacking together a little script that turns live synth beats into glitchy visuals—think code‑driven synthwave art. Want to see the demo or maybe tweak it together?
Sounds like a perfect playground for glitch art, love it. Drop the code here and I’ll run it through a VFX pipeline and see how it morphs into synthwave visual noise.
Here’s a minimal Python demo that grabs the waveform from a WAV file, turns it into a pixel array, and throws in a few glitch filters. It’s ready to feed into whatever VFX pipeline you’ve got.
```python
#!/usr/bin/env python3
# synthwave_glitch.py
# run: python synthwave_glitch.py input.wav output.png
import sys, wave, numpy as np, imageio
from scipy.signal import butter, lfilter
def butter_bandpass(lowcut, highcut, fs, order=5):
nyq = 0.5 * fs
low = lowcut / nyq
high = highcut / nyq
b, a = butter(order, [low, high], btype='band')
return b, a
def glitch_array(arr, amount=0.1):
"""Simple glitch: random pixel shift and color inversion"""
h, w = arr.shape[:2]
shift = int(h * amount)
arr = np.roll(arr, shift, axis=0) # vertical shift
if np.random.rand() > 0.5:
arr = 255 - arr # invert
return arr
def main(input_wav, output_png):
# Read WAV
wf = wave.open(input_wav, 'rb')
fs = wf.getframerate()
nframes = wf.getnframes()
raw = wf.readframes(nframes)
wf.close()
audio = np.frombuffer(raw, dtype=np.int16).astype(np.float32)
# Normalize and band‑pass to focus on synth mids
audio /= 32768
b, a = butter_bandpass(200, 8000, fs, order=4)
filtered = lfilter(b, a, audio)
# Create a 2D waveform image (time vs amplitude)
img = np.abs(filtered).reshape(1, -1) # 1‑row strip
img = np.repeat(img, 256, axis=0) # 256‑pixel tall
# Map amplitude to RGB (synthwave teal‑pink palette)
palette = np.array([[0, 255, 255], [255, 0, 255]], dtype=np.uint8)
idx = (img * 1.999).astype(int) # 0 or 1
img_rgb = palette[idx.squeeze()]
# Apply glitch
img_glitch = glitch_array(img_rgb, amount=0.05)
# Save
imageio.imwrite(output_png, img_glitch)
print(f"Saved glitch art to {output_png}")
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: synthwave_glitch.py input.wav output.png")
sys.exit(1)
main(sys.argv[1], sys.argv[2])
```
Just drop your synth‑drum loop into `input.wav`, run the script, and watch that wave become a neon glitch. Feel free to tweak the band‑pass, the `amount` in `glitch_array`, or the palette to match your VFX flavor. Happy hacking!
That’s a slick starter, love how it slices the synth mids and paints the wave in teal‑pink. Maybe try a wavetable that fades in at the start so the glitch syncs to a beat hit, or swap the palette for a neon‑purple gradient to push the cyberpunk vibe. If you hit any hiccups, just ping me—happy to tweak the filters or add a side‑by‑side composite in the VFX pipeline. Happy glitching!