Tomita Documentation Release 0.2.0
Total Page:16
File Type:pdf, Size:1020Kb
tomita Documentation Release 0.2.0 g4brielvs May 04, 2020 Contents: 1 python-tomita 3 1.1 About...................................................3 1.2 Features..................................................3 1.3 PySynth..................................................3 1.4 License..................................................4 2 Installation 5 2.1 Stable release...............................................5 2.2 From sources...............................................5 3 Usage 7 4 tomita 9 4.1 tomita package..............................................9 5 Contributing 13 5.1 Types of Contributions.......................................... 13 5.2 Get Started!................................................ 14 5.3 Pull Request Guidelines......................................... 15 5.4 Tips.................................................... 15 5.5 Deploying................................................ 15 6 Credits 17 6.1 Development Lead............................................ 17 6.2 Contributors............................................... 17 7 History 19 7.1 0.2.0 (2020-05-03)............................................ 19 7.2 0.1.0 (2020-05-02)............................................ 19 8 Indices and tables 21 Python Module Index 23 Index 25 i ii tomita Documentation, Release 0.2.0 Contents: 1 tomita Documentation, Release 0.2.0 2 Contents: CHAPTER 1 python-tomita tomita is a command-line music and synthesizer package. • Free software: GNU General Public License v3 • Documentation: https://tomita.readthedocs.io. 1.1 About Isao Tomita ( , Tomita Isao, 22 April 1932 – 5 May 2016), also known mononymically as Tomita, was a Japanese music-composer, regarded as one of the pioneers of electronic music and space music,and as one of the most famous producers of analog synthesizer arrangements. Wikipedia 1.2 Features • TODO 1.3 PySynth All scripts from PySynth can the found as modules. To use pysynth: 3 tomita Documentation, Release 0.2.0 $ python -m tomita.legacy.pysynth To use pysynth_b: $ python -m tomita.legacy.pysynth_b To use pysynth_c: $ python -m tomita.legacy.pysynth_c and so on. 1.4 License GNU General Public License v3.0 4 Chapter 1. python-tomita CHAPTER 2 Installation 2.1 Stable release To install tomita, run this command in your terminal: $ pip install tomita This is the preferred method to install tomita, as it will always install the most recent stable release. If you don’t have pip installed, this Python installation guide can guide you through the process. 2.2 From sources The sources for tomita can be downloaded from the repo. You can either clone the public repository: $ git clone https://github.com/g4brielvs/python-tomita.git Or download the tarball: $ curl -OJL https://github.com/g4brielvs/python-tomita/tarball/master Once you have a copy of the source, you can install it with: $ python setup.py install 5 tomita Documentation, Release 0.2.0 6 Chapter 2. Installation CHAPTER 3 Usage To use tomita in a project: import tomita 7 tomita Documentation, Release 0.2.0 8 Chapter 3. Usage CHAPTER 4 tomita 4.1 tomita package 4.1.1 Subpackages tomita.core package Module contents 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) tomita.legacy.mkfreq module tomita.legacy.mkfreq.getfn(layer) tomita.legacy.mkfreq.getfreq(pr=False) 9 tomita Documentation, Release 0.2.0 tomita.legacy.nokiacomposer2wav module tomita.legacy.play_wav module Audio playback with pyaudio, tkSnack, pyglet or console media player depending on availability. Pranav Ravichan- dran <[email protected]> class tomita.legacy.play_wav.Sound(fn=None) Bases: object load(fn) playFile(mediaFile, repeat=0) Play the .wav file. play_media(mediaFile) In absence of audio playback frameworks, just use an OS-based console media player. play_pyaudio(mediaFile) Use pyaudio backend to play the .wav. play_pyglet(mediaFile) Use pyglet backend to play the .wav. play_tkSnack(mediaFile) Use tkSnack backend to play the .wav. tomita.legacy.pysynth module # # Martin C. Doege, 2009-04-07 ([email protected]) ########################################################################## # 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, re- peat=0, fn=’out.wav’, silent=False) tomita.legacy.pysynth_b module tomita.legacy.pysynth_beeper module tomita.legacy.pysynth_beeper.make_wav(song, tempo=120, transpose=0, fn=’out.wav’) tomita.legacy.pysynth_c module # # Martin C. Doege, 2017-06-20 ([email protected]) ########################################################################## # Based on a program by Tyler Eaves (tyler at tylereaves.com) found at # http://mail.python.org/pipermail/python-list/ 2000-August/041308.html ########################################################################## 10 Chapter 4. tomita tomita Documentation, Release 0.2.0 # ‘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, re- peat=0, fn=’out.wav’, silent=False) 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 follow- ing 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, IN- CIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSI- NESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CON- TRACT, 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 DAM- AGE. class tomita.legacy.readmidi.MidiFile(file_name) Bases: object Represents the notes in a MIDI file read_byte(file) read_variable_length(file, counter) 4.1. tomita package 11 tomita Documentation, Release 0.2.0 class tomita.legacy.readmidi.Note(channel, pitch, velocity, start, duration=0) Bases: object Represents a single MIDI note get_end() note_names = ['A', 'A#', 'B', 'C', 'C#', 'D', 'D#', 'E', 'F', 'F#', 'G', 'G#'] tomita.legacy.readmidi.getdur(a, b) Calculate note length for PySynth tomita.legacy.setup module tomita.legacy.test_nokiacomposer2wav module Module contents 4.1.2 Submodules 4.1.3 tomita.cli module 4.1.4 tomita.tomita module Main module. 4.1.5 Module contents Top-level package for python-tomita. 12 Chapter 4. tomita CHAPTER 5 Contributing Contributions are welcome, and they are greatly appreciated! Every little bit helps, and credit will always be given. You can contribute in many ways: 5.1 Types of Contributions 5.1.1 Report Bugs Report bugs at https://github.com/g4brielvs/python-tomita/issues. If you are reporting a bug, please include: • Your operating system name and version. • Any details about your local setup that might be helpful in troubleshooting. • Detailed steps to reproduce the bug. 5.1.2 Fix Bugs Look through the GitHub issues for bugs. Anything tagged with “bug” and “help wanted” is open to whoever wants to implement it. 5.1.3 Implement Features Look through the GitHub issues for features. Anything tagged with “enhancement” and “help wanted” is open to whoever wants to implement it. 13 tomita Documentation, Release 0.2.0 5.1.4 Write Documentation python-tomita could always use more documentation, whether as part