Skip to main content

Python bindings for WaoN - Wave-to-Notes transcriber

Project description

WaoN Python Bindings

Python bindings for WaoN - Wave-to-Notes transcriber.

Installation

From source

pip install maturin
maturin develop --release

From wheel

pip install waon

Usage

Basic transcription

import waon
import numpy as np

# Transcribe an audio file
midi_bytes = waon.transcribe_file("audio.wav")
with open("output.mid", "wb") as f:
    f.write(midi_bytes)

# Transcribe audio data
audio_data = np.array([...], dtype=np.float32)
midi_bytes = waon.transcribe(audio_data, sample_rate=44100)

Advanced usage with options

import waon

# Create custom options
options = waon.WaonOptions()
options.fft_size = 4096
options.hop_size = 2048
options.window_type = "hamming"
options.note_bottom = 36  # C2
options.note_top = 96     # C7
options.velocity_threshold = 0.005
options.use_phase_vocoder = True

# Create context with options
context = waon.WaonContext(
    fft_size=4096,
    hop_size=2048,
    window_type="hamming"
)

# Transcribe
midi_bytes = context.transcribe_file("audio.wav")

# Analyze a single frame
audio_frame = np.array([...], dtype=np.float32)
note_intensities = context.analyze(audio_frame)  # Returns 128-element array

API Reference

Functions

  • transcribe(audio, sample_rate=44100, options=None) - Transcribe audio array to MIDI
  • transcribe_file(path, options=None) - Transcribe audio file to MIDI
  • get_version() - Get library version

Classes

  • WaonContext - Transcription context for stateful processing
  • WaonOptions - Configuration options for transcription

Window Types

  • hanning (default)
  • hamming
  • blackman
  • nuttall
  • blackman2, blackman3, blackman4
  • exponentialsine
  • parzen
  • welch
  • steeper30, steeper60

License

GPL-2.0-or-later

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

waon-0.1.1-cp39-abi3-manylinux_2_34_x86_64.whl (1.3 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.34+ x86-64

File details

Details for the file waon-0.1.1-cp39-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for waon-0.1.1-cp39-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 6b55a661d6fc49c5f7fa5249b4d9671d7fa4907e12336e1a5ae41230737f65c2
MD5 ba1e1631a50a778391105c760d829fb4
BLAKE2b-256 666b18bfe944e30e6b351b23044fd8a35a24f23c750a9631891bb75a8e8b9c74

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