sublibs package¶
Submodules¶
parts module¶
Miscellaneous Functions.
paramsmid module¶
Analyze MIDI files according to SMF (Standard MIDI File) format.
- reference:
MIDI1.0規格書(日本語版98.1) ISBN4-8456-0348-9 C3055 http://www.amei.or.jp/
MIDI 1.0
スタンダードMIDIファイル1.0
- Todo:
Compile automatically.
- class StandardMidiFile¶
ベースクラス:
object
StandardMidiFile analyzes SMF(Standard MIDI File).
- パラメータ:
midifile (pathlib.Path) -- target SMF(Standard MIDI File)
- channels_preset()¶
Get a list of preset numbers for each of the 16 channels.
- 戻り値:
list of prest numbers
- instruments()¶
Get a list of instrument names for each of the 16 channels.
- 戻り値:
instruments
- lyrics()¶
Get lyrics list.
- 戻り値:
lyrics
- title()¶
Get Title.
- 戻り値:
title
- total_tick()¶
Count ticks.
- 戻り値:
total ticks
csv2mid module¶
Generate a MID(Standard MIDI File) file from a CSV file.
Format of CSV file
<Format> = <Track Name>, <Bar Number>, <Tick Number>, <Event List>, <Value List>
- Track Name
Track Name.
example: "Sequencer"
example: "Main Melody"
example: "Sub Melody"
- Bar Number
Indicates the order of appearance of the measures.
example: 0
example: 1
- Tick Number
Indicates the timing of event occurrence within a bar in terms of Tick conversion. However, the length of a quarter note is 480 ticks.
example: 0
example: 480
example: 960
- Event List
Event.
example: "Meta Event","Set Tempo"
example: "Midi Event","Note On"
example: "Midi Event","Control Change","Channel Volume"
- Value List
Event Value.
example: 500000
example: 0,69,0x40,200
example: 0,0x60
- restrictions
Only "GM System Level 1".
Tempo changes and odd time signatures are not supported.
The division is fixed at 480.
- exception SmfError(*args)[ソース]¶
ベースクラス:
Exception
Exceptions sent out from errcheck func.
- パラメータ:
args (object) --
- 戻り値の型:
None
- class AllNotesOff(track, bar='0', tick='0', n='0')[ソース]¶
ベースクラス:
_ChannelMode
AllNoteOff is "all notes off message".
- パラメータ:
track (str) --
bar (dataclasses.InitVar[str]) --
tick (dataclasses.InitVar[str]) --
n (str) --
- class ChannelPressure(track, bar='0', tick='0', n='0', vv='100')[ソース]¶
ベースクラス:
_MidiEvent
- パラメータ:
track (str) --
bar (dataclasses.InitVar[str]) --
tick (dataclasses.InitVar[str]) --
n (str) --
vv (str) --
- n: str = '0'¶
channle
- Type:
str
- vv: str = '100'¶
threshold
- Type:
int
- class ChannelVolume(track, bar='0', tick='0', n='0', vv='0x70')[ソース]¶
ベースクラス:
_ControlChange
ChannelVolume is "Channel Volume".
- パラメータ:
track (str) --
bar (dataclasses.InitVar[str]) --
tick (dataclasses.InitVar[str]) --
n (str) --
vv (str) --
- vv: str = '0x70'¶
value
- Type:
str
- class CopyrightNotice(track, bar='0', tick='0', text='')[ソース]¶
ベースクラス:
_MetaEvnet
CopyrightNotice is class.
- パラメータ:
track (str) --
bar (dataclasses.InitVar[str]) --
tick (dataclasses.InitVar[str]) --
text (str) --
- text: str = ''¶
Copyright Notice
- Type:
str
- class EndOfTrack(track, bar='0', tick='0')[ソース]¶
ベースクラス:
_MetaEvnet
end of track
- パラメータ:
track (str) --
bar (dataclasses.InitVar[str]) --
tick (dataclasses.InitVar[str]) --
- track: str¶
"track" is a name that identifies a track.
- Type:
str
- class Expression(track, bar='0', tick='0', n='0', vv='0x70')[ソース]¶
ベースクラス:
_ControlChange
Expresson is "Expression".
- パラメータ:
track (str) --
bar (dataclasses.InitVar[str]) --
tick (dataclasses.InitVar[str]) --
n (str) --
vv (str) --
- vv: str = '0x70'¶
value
- Type:
str
- class GmSystemOn(track, bar='0', tick='0')[ソース]¶
ベースクラス:
_SystemExclusiveEvent
GM System Level 1.
- パラメータ:
track (str) --
bar (dataclasses.InitVar[str]) --
tick (dataclasses.InitVar[str]) --
- track: str¶
"track" is a name that identifies a track.
- Type:
str
- class HeaderChunk(format=1, ntrks=1, division=480)[ソース]¶
ベースクラス:
object
HeaderChunk is a class that generates "Header chunks".
- パラメータ:
format (int) --
ntrks (int) --
division (int) --
- division: int = 480¶
"division" specifies the meaning of the delta-times. ticks per quarter-note.
- Type:
int
- format: int = 1¶
"format" specifies the overall organisation of the file.
- Type:
int
- ntrks: int = 1¶
"ntrks" is the number of track chunks in the file.
- Type:
int
- class InstrumentName(track, bar='0', tick='0', text='')[ソース]¶
ベースクラス:
_MetaEvnet
InstrumentName is class.
- パラメータ:
track (str) --
bar (dataclasses.InitVar[str]) --
tick (dataclasses.InitVar[str]) --
text (str) --
- text: str = ''¶
Instrument Name
- Type:
str
- class KeySignature(track, bar='0', tick='0', sf='0', mi='0')[ソース]¶
ベースクラス:
_MetaEvnet
KeySignature is expressed as four numbers.
- パラメータ:
track (str) --
bar (dataclasses.InitVar[str]) --
tick (dataclasses.InitVar[str]) --
sf (str) --
mi (str) --
- mi: str = '0'¶
0 is major, 1 is minor
- Type:
str
- sf: str = '0'¶
0 is C, +1 ~ +7 is #, -1 ~ -7 is b
- Type:
str
- class Lyric(track, bar='0', tick='0', text='')[ソース]¶
ベースクラス:
_MetaEvnet
Lyric is class.
- パラメータ:
track (str) --
bar (dataclasses.InitVar[str]) --
tick (dataclasses.InitVar[str]) --
text (str) --
- text: str = ''¶
Lyric
- Type:
str
- class ModulationWheel(track, bar='0', tick='0', n='0', vv='0')[ソース]¶
ベースクラス:
_ControlChange
ModulationWeel is "Modulation Wheel".
- パラメータ:
track (str) --
bar (dataclasses.InitVar[str]) --
tick (dataclasses.InitVar[str]) --
n (str) --
vv (str) --
- vv: str = '0'¶
value
- Type:
str
- class NoteOffAfterOn(track, bar='0', tick='0', n='0', kk='60', vv='0x20')[ソース]¶
ベースクラス:
_MidiEvent
NoteOffAfterOn is "Note off".
- パラメータ:
track (str) --
bar (dataclasses.InitVar[str]) --
tick (dataclasses.InitVar[str]) --
n (str) --
kk (str) --
vv (str) --
- kk: str = '60'¶
key number
- Type:
str
- n: str = '0'¶
channel
- Type:
str
- vv: str = '0x20'¶
velocity
- Type:
str
- class NoteOn(track, bar='0', tick='0', n='0', kk='60', vv='0x40', dr='100')[ソース]¶
ベースクラス:
_MidiEvent
NoteOn is "Note On".
- パラメータ:
track (str) --
bar (dataclasses.InitVar[str]) --
tick (dataclasses.InitVar[str]) --
n (str) --
kk (str) --
vv (str) --
dr (str) --
- dr: str = '100'¶
duration
- Type:
str
- kk: str = '60'¶
key number
- Type:
str
- n: str = '0'¶
channel
- Type:
str
- vv: str = '0x40'¶
velocity
- Type:
str
- class Pan(track, bar='0', tick='0', n='0', vv='0x40')[ソース]¶
ベースクラス:
_ControlChange
Pan is "Pan".
- パラメータ:
track (str) --
bar (dataclasses.InitVar[str]) --
tick (dataclasses.InitVar[str]) --
n (str) --
vv (str) --
- vv: str = '0x40'¶
str:
- class PitchWheelChange(track, bar='0', tick='0', n='0', ll='0', mm='0x40')[ソース]¶
ベースクラス:
_MidiEvent
- パラメータ:
track (str) --
bar (dataclasses.InitVar[str]) --
tick (dataclasses.InitVar[str]) --
n (str) --
ll (str) --
mm (str) --
- ll: str = '0'¶
LSB, centre(non-effect) is 0x00
- Type:
str
- mm: str = '0x40'¶
MSB, centre(non-effect) is 0x40
- Type:
str
- n: str = '0'¶
channel
- Type:
str
- class ProgramChange(track, bar='0', tick='0', n='0', vv='0')[ソース]¶
ベースクラス:
_MidiEvent
- パラメータ:
track (str) --
bar (dataclasses.InitVar[str]) --
tick (dataclasses.InitVar[str]) --
n (str) --
vv (str) --
- n: str = '0'¶
channle
- Type:
str
- vv: str = '0'¶
preset number
- Type:
str
- class ResetAllControllers(track, bar='0', tick='0', n='0')[ソース]¶
ベースクラス:
_ChannelMode
- パラメータ:
track (str) --
bar (dataclasses.InitVar[str]) --
tick (dataclasses.InitVar[str]) --
n (str) --
- class SequencerTrackName(track, bar='0', tick='0', text='')[ソース]¶
ベースクラス:
_MetaEvnet
SequenceTrackName is class.
- パラメータ:
track (str) --
bar (dataclasses.InitVar[str]) --
tick (dataclasses.InitVar[str]) --
text (str) --
- text: str = ''¶
Sequencer / Track Name
- Type:
str
- class SetTempo(track, bar='0', tick='0', value='500000')[ソース]¶
ベースクラス:
_MetaEvnet
Quarter note microsecond unit time.
- パラメータ:
track (str) --
bar (dataclasses.InitVar[str]) --
tick (dataclasses.InitVar[str]) --
value (str) --
- value: str = '500000'¶
Quarter note microsecond unit time
- Type:
str
- class SustainOff(track, bar='0', tick='0', n='0')[ソース]¶
ベースクラス:
_ControlChange
- パラメータ:
track (str) --
bar (dataclasses.InitVar[str]) --
tick (dataclasses.InitVar[str]) --
n (str) --
- class SustainOn(track, bar='0', tick='0', n='0')[ソース]¶
ベースクラス:
_ControlChange
- パラメータ:
track (str) --
bar (dataclasses.InitVar[str]) --
tick (dataclasses.InitVar[str]) --
n (str) --
- class TextEvent(track, bar='0', tick='0', text='')[ソース]¶
ベースクラス:
_MetaEvnet
TextEvent is class.
- パラメータ:
track (str) --
bar (dataclasses.InitVar[str]) --
tick (dataclasses.InitVar[str]) --
text (str) --
- text: str = ''¶
text event
- Type:
str
- class TimeSignature(track, bar='0', tick='0', nn='4', dd='2', cc='24', bb='8')[ソース]¶
ベースクラス:
_MetaEvnet
TimeSignature is expressed as four numbers.
- パラメータ:
track (str) --
bar (dataclasses.InitVar[str]) --
tick (dataclasses.InitVar[str]) --
nn (str) --
dd (str) --
cc (str) --
bb (str) --
- bb: str = '8'¶
str:
- cc: str = '24'¶
str:
- dd: str = '2'¶
power to two, rhythm notevalue
- Type:
str
- nn: str = '4'¶
rhythm beat
- Type:
str
Module contents¶
Packages of support modules
parts: Gain control for MIDI devices
csv2mid: Generate a MID(Standard MIDI File) file from a CSV file.
paramsmid: Parsing SMF(Standard MIDI File) files