radiotool - tools for constructing and retargeting audio

Radiotool is a python library that aims to make it easy to create audio by piecing together bits of other audio files. This library was originally written to enable my research in audio editing user interfaces, but perhaps someone else might find it useful.

To perform the actual audio rendering, radiotool relies on scikits.audiolab, a python wrapper for libsndfile.

The library source is hosted on GitHub here.

Contents:

Simple examples

Basic usage

from radiotool.composer import *
comp = Composition()

# create a track with a pre-existing wav file
track = Track("test.wav")

# create a segment of a track that:
# 1. starts at the 0.0 mark of the composition
# 2. begins playing at the 0.5 second mark of the track
# 3. plays for 1.0 seconds
segment = Segment(track, 0.0, 0.5, 1.0)

# add segment to the composition
comp.add_segment(segment)

# output your composition as a numpy array
arr_out = comp.build()

# or export your composition as an audio file, composition.wav
comp.export(filename="composition")

Simple extension or shortening of music

from radiotool.composer import Song
from radiotool.algorithms.retarget import retarget_to_length

song = Song("music_file.wav")

# new song should be 1000 seconds long
composition = retarget_to_length(song, 1000)

# new song that's only 30 seconds long
short_composition = retarget_to_length(song, 30)

# export to audio file
composition.export(filename="retarget_length_test")
short_composition.export(filename="short_retarget_length_test")

See the documentation for more detailed examples (coming soon!).

Composition

radiotool.composer.Composition

Tracks

radiotool.composer.Track
radiotool.composer.Speech
radiotool.composer.Song
radiotool.composer.RawTrack

Segments

radiotool.composer.Segment
radiotool.composer.TimeStretchSegment

Dynamics

radiotool.composer.Dynamic
radiotool.composer.Volume
radiotool.composer.Fade
radiotool.composer.RawVolume
radiotool.composer.VolumeBreakpoint

Algorithms

radiotool.algorithms.retarget.retarget_to_length
radiotool.algorithms.retarget.retarget_with_change_points
radiotool.algorithms.retarget.retarget
radiotool.algorithms.novelty

Utilities

radiotool.utils A set of utility functions that are used elsewhere in radiotool

Indices and tables