Skip to main content

Named after Jupiter's icy moon — a Python audio library for analysis, synthesis, effects and more

Project description

🌙 Moon Europa — Python Audio Library

Named after Europa, the icy moon of Jupiter — hiding an ocean beneath its frozen surface. Just like Europa conceals depths of mystery, this library gives you deep control over audio.

Moon Europa (mooneuropa) is a comprehensive, batteries-included audio processing library for Python. Install it as mooneuropa, use it as europa.

Installation

pip install mooneuropa
# with MP3 + visualization support:
pip install mooneuropa[all]

Quick Start

import europa

# Load audio
audio = europa.load("song.mp3")
print(audio)  # <Audio | mono | sr=22050 Hz | duration=180.0s>

# Playback
europa.play(audio)

# Record from microphone
rec = europa.record(5.0)

# Save
europa.save(audio, "output.wav")

Feature Extraction

mfcc     = europa.feature.mfcc(audio, n_mfcc=13)
mel      = europa.feature.mel_spectrogram(audio, n_mels=128)
chroma   = europa.feature.chroma(audio)
centroid = europa.feature.spectral_centroid(audio)
zcr      = europa.feature.zero_crossing_rate(audio)
rms      = europa.feature.rms_energy(audio)
tonnetz  = europa.feature.tonnetz(audio)

Effects

slow   = europa.effects.time_stretch(audio, rate=0.8)
higher = europa.effects.pitch_shift(audio, semitones=3)
bass   = europa.effects.low_pass(audio, cutoff=200)
bright = europa.effects.high_pass(audio, cutoff=5000)
loud   = europa.effects.gain(audio, db=6)
comp   = europa.effects.compress(audio, threshold_db=-20, ratio=4.0)
dist   = europa.effects.distort(audio, drive=10.0)
stereo = europa.effects.pan(audio, amount=0.5)
wet    = europa.effects.reverb(audio, room_size=0.7)
echo   = europa.effects.echo(audio, delay=0.3, decay=0.5)
faded  = europa.effects.fade_in(audio, duration=0.5)
clean  = europa.effects.noise_reduce(audio)

Synthesis

tone    = europa.synthesis.sine(440, duration=1.0)
buzz    = europa.synthesis.square(110, duration=2.0)
wn      = europa.synthesis.noise(1.0, color="white")
pn      = europa.synthesis.noise(1.0, color="pink")
note    = europa.synthesis.apply_adsr(tone, attack=0.01, decay=0.1, sustain=0.7, release=0.2)
c_major = europa.synthesis.chord([261.63, 329.63, 392.0], duration=2.0)
mixed   = europa.synthesis.mix(bass, drums, melody)

Analysis

bpm, beat_times = europa.analysis.beat_track(audio)
onsets          = europa.analysis.onset_detect(audio)
times, freqs    = europa.analysis.pitch_track(audio)
key             = europa.analysis.key_detect(audio)  # e.g. "A minor"

Visualization

europa.display.waveform(audio)
europa.display.spectrogram(audio)
europa.display.mel_spectrogram(audio)
europa.display.mfcc(audio)
europa.display.chroma(audio)
europa.display.beats(audio, beat_times)
europa.display.all_features(audio)

Audio Object

audio.duration   # float: seconds
audio.sr         # int: sample rate
audio.channels   # int: 1 or 2
audio.rms        # float
audio.peak       # float
audio.is_mono    # bool
audio.info()     # dict

clip   = audio.slice_time(1.0, 3.0)
joined = audio1 + audio2

Dependencies

Package Purpose
numpy Core array operations
scipy Filters, resampling, DCT
soundfile WAV/FLAC/OGG I/O
sounddevice Playback & recording
audioread MP3 decoding (optional)
matplotlib Visualization (optional)

🌙 "Beneath the ice, an ocean. Beneath the silence, sound."

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mooneuropa-0.1.0.tar.gz (24.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mooneuropa-0.1.0-py3-none-any.whl (27.2 kB view details)

Uploaded Python 3

File details

Details for the file mooneuropa-0.1.0.tar.gz.

File metadata

  • Download URL: mooneuropa-0.1.0.tar.gz
  • Upload date:
  • Size: 24.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for mooneuropa-0.1.0.tar.gz
Algorithm Hash digest
SHA256 07a94b6a456de22228258a7193e250b88719280abdb75c2f7479ce161d9caee9
MD5 efe338a8104d07e60976e20c245b02ff
BLAKE2b-256 10dc57f0931924355713a690b2c9fa584c44ebb6e06d22a4eb9aab8bf23c83a3

See more details on using hashes here.

File details

Details for the file mooneuropa-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: mooneuropa-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 27.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for mooneuropa-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 12e78b4dc47e5b40cdc3de422bc50b337b9ca1ddd6dd8cea5960348e532ca931
MD5 10f9f7fbb04a82276a71183757c5cb8e
BLAKE2b-256 9c9ca0223126f2a81140b24891ec6030348914674aedd27644cedf2dfe39a006

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page