Event Plot
Audio Transient Visualization
Music production transient events with neon cyberpunk aesthetic
Output
Python
import matplotlib.pyplot as plt
import numpy as np
# Simulate audio transient events
np.random.seed(42)
tracks = ['Drums', 'Bass', 'Synth', 'Vocals', 'FX']
transients = [
np.sort(np.concatenate([np.arange(0, 16, 0.5), np.arange(0, 16, 1) + 0.25])),
np.sort(np.arange(0, 16, 1)),
np.random.uniform(0, 16, 40),
np.sort(np.random.uniform(2, 14, 25)),
np.sort(np.random.exponential(0.8, 30).cumsum()),
]
transients[-1] = transients[-1][transients[-1] < 16]
# Neon colors
neon = ['#FF0080', '#00FFFF', '#FFFF00', '#FF00FF', '#00FF00']
# Create figure
fig, ax = plt.subplots(figsize=(12, 6), facecolor='#0a0a0a')
ax.set_facecolor('#0a0a0a')
for i, (trans, color) in enumerate(zip(transients, neon)):
# Glow layers
for lw, alpha in [(6, 0.15), (4, 0.3), (2, 0.6)]:
ax.eventplot(trans, lineoffsets=i, linelengths=0.6, linewidths=lw,
colors=color, alpha=alpha)
# Core line
ax.eventplot(trans, lineoffsets=i, linelengths=0.5, linewidths=1,
colors='white', alpha=0.9)
# Beat grid
for beat in range(0, 17, 4):
ax.axvline(beat, color='#333333', linewidth=1.5, alpha=0.8)
for beat in range(0, 17, 1):
ax.axvline(beat, color='#1a1a1a', linewidth=0.5, alpha=0.8)
# Bar numbers
for bar in range(4):
ax.text(bar * 4 + 2, 4.8, f'Bar {bar + 1}', ha='center', fontsize=10,
color='#666666', fontweight='500')
# Horizontal scan lines
for y in np.arange(-0.5, 5, 0.25):
ax.axhline(y, color='#111111', linewidth=0.3, alpha=0.5)
# Styling
ax.set_yticks(range(len(tracks)))
ax.set_yticklabels(tracks, fontsize=11, fontweight='600', color='white')
ax.set_xlabel('BEATS', fontsize=11, fontweight='600', color='#00FFFF', labelpad=10)
ax.set_xlim(0, 16)
ax.set_ylim(-0.5, len(tracks) - 0.3)
ax.spines['top'].set_visible(False)
ax.spines['right'].set_visible(False)
ax.spines['left'].set_color('#333333')
ax.spines['bottom'].set_color('#333333')
ax.tick_params(colors='#888888', labelsize=10)
# Corner decoration
ax.text(0.02, 0.98, '◢', transform=ax.transAxes, fontsize=14,
color='#00FFFF', alpha=0.5, va='top')
ax.text(0.98, 0.98, '◣', transform=ax.transAxes, fontsize=14,
color='#FF0080', alpha=0.5, va='top', ha='right')
plt.tight_layout()
plt.show()
Library
Matplotlib
Category
Statistical
More Event Plot examples
☕