Skip to main content

Toolkit with music synthesis and analysis tools for python.

Project description

pymusicbox

A library with toolkits for music synthesis and analysis. This is a work in progress.

Current Features

  • Symbolic language to represent notes and tracks
  • Create instruments with sine oscilators and harmonics

Installation

pip install pymusicbox

Example Usage

from pymusicbox.synth.instrument.oscillator import HarmonicOscillator, HarmonicsConfiguration
from pymusicbox.symbolic.symbols import Note, NoteEvent, Track

track = Track(events=[
  NoteEvent(time=0, note=Note(pitch='C', octave=3, length=1, velocity=100)),
  NoteEvent(time=1, note=Note(pitch='D', octave=3, length=1, velocity=80)),
  NoteEvent(time=2, note=Note(pitch='E', octave=3, length=1, velocity=90)),
  NoteEvent(time=2, note=Note(pitch='A', octave=3, length=1, velocity=100)),
  NoteEvent(time=3, note=Note(pitch='A', octave=3, length=1.8, velocity=110)),
  NoteEvent(time=3, note=Note(pitch='D', octave=2, length=1.8, velocity=110)),
])

harmonics = HarmonicsConfiguration(attack=0.1, decay=0.2, release=0.2, sustain_factor=0.6)
oscillator = HarmonicOscillator(harmonics=harmonics)
audio = oscillator.render_track(track)
audio.write('output.wav')

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

pymusicbox-0.0.3.tar.gz (5.8 kB view hashes)

Uploaded Source

Built Distribution

pymusicbox-0.0.3-py3-none-any.whl (6.7 kB view hashes)

Uploaded Python 3

Supported by

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