tomita.legacy package

Submodules

tomita.legacy.demosongs module

tomita.legacy.menv module

tomita.legacy.mixfiles module

tomita.legacy.mixfiles.mix_files(a, b, c, chann=2, phase=-1.0)[source]

tomita.legacy.mkfreq module

tomita.legacy.mkfreq.getfn(layer)[source]
tomita.legacy.mkfreq.getfreq(pr=False)[source]

tomita.legacy.nokiacomposer2wav module

tomita.legacy.play_wav module

Audio playback with pyaudio, tkSnack, pyglet or console media player depending on availability. Pranav Ravichandran <me@onloop.net>

class tomita.legacy.play_wav.Sound(fn=None)[source]

Bases: object

load(fn)[source]
playFile(mediaFile, repeat=0)[source]

Play the .wav file.

play_media(mediaFile)[source]

In absence of audio playback frameworks, just use an OS-based console media player.

play_pyaudio(mediaFile)[source]

Use pyaudio backend to play the .wav.

play_pyglet(mediaFile)[source]

Use pyglet backend to play the .wav.

play_tkSnack(mediaFile)[source]

Use tkSnack backend to play the .wav.

tomita.legacy.pysynth module

# # Martin C. Doege, 2009-04-07 (mdoege@compuserve.com) ########################################################################## # Based on a program by Tyler Eaves (tyler at tylereaves.com) found at # http://mail.python.org/pipermail/python-list/2000-August/041308.html ##########################################################################

# ‘song’ is a Python list (or tuple) in which the song is defined, # the format is [[‘note’, value]]

# Notes are ‘a’ through ‘g’ of course, # optionally with ‘#’ or ‘b’ appended for sharps or flats. # Finally the octave number (defaults to octave 4 if not given). # An asterisk at the end makes the note a little louder (useful for the beat). # ‘r’ is a rest.

# Note value is a number: # 1=Whole Note; 2=Half Note; 4=Quarter Note, etc. # Dotted notes can be written in two ways: # 1.33 = -2 = dotted half # 2.66 = -4 = dotted quarter # 5.33 = -8 = dotted eighth

tomita.legacy.pysynth.make_wav(song, bpm=120, transpose=0, pause=0.05, boost=1.1, repeat=0, fn='out.wav', silent=False)[source]

tomita.legacy.pysynth_b module

tomita.legacy.pysynth_beeper module

tomita.legacy.pysynth_beeper.make_wav(song, tempo=120, transpose=0, fn='out.wav')[source]

tomita.legacy.pysynth_c module

# # Martin C. Doege, 2017-06-20 (mdoege@compuserve.com) ########################################################################## # Based on a program by Tyler Eaves (tyler at tylereaves.com) found at # http://mail.python.org/pipermail/python-list/2000-August/041308.html ##########################################################################

# ‘song’ is a Python list (or tuple) in which the song is defined, # the format is [[‘note’, value]]

# Notes are ‘a’ through ‘g’ of course, # optionally with ‘#’ or ‘b’ appended for sharps or flats. # Finally the octave number (defaults to octave 4 if not given). # An asterisk at the end makes the note a little louder (useful for the beat). # ‘r’ is a rest.

# Note value is a number: # 1=Whole Note; 2=Half Note; 4=Quarter Note, etc. # Dotted notes can be written in two ways: # 1.33 = -2 = dotted half # 2.66 = -4 = dotted quarter # 5.33 = -8 = dotted eighth

tomita.legacy.pysynth_c.make_wav(song, bpm=120, transpose=0, pause=0.05, boost=1.1, repeat=0, fn='out.wav', silent=False)[source]

tomita.legacy.pysynth_d module

tomita.legacy.pysynth_e module

tomita.legacy.pysynth_p module

tomita.legacy.pysynth_s module

tomita.legacy.pysynth_samp module

tomita.legacy.read_abc module

tomita.legacy.readmidi module

Copyright (c) 2014, Thomas J. Webb All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

class tomita.legacy.readmidi.MidiFile(file_name)[source]

Bases: object

Represents the notes in a MIDI file

read_byte(file)[source]
read_variable_length(file, counter)[source]
class tomita.legacy.readmidi.Note(channel, pitch, velocity, start, duration=0)[source]

Bases: object

Represents a single MIDI note

get_end()[source]
note_names = ['A', 'A#', 'B', 'C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#']
tomita.legacy.readmidi.getdur(a, b)[source]

Calculate note length for PySynth

tomita.legacy.setup module

tomita.legacy.test_nokiacomposer2wav module

Module contents