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.0-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.0-cp39-abi3-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for waon-0.1.0-cp39-abi3-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 60f272c61bc69834b17a66e9c614976f19654cc76adb6e83fd75459a1882d002
MD5 a1c24c36261f36f85e9ccbe0171d6868
BLAKE2b-256 583ce44e608be4743bc06af7706912c1c11a5a6b4b2adde4c93d00b859535eb9

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