data_structures
midi.py
- class MIDIEvent
Bases:
objectMIDIEvent(channel: ‘int’, value: ‘float’, time: ‘float’)
- __init__(channel: int, value: float, time: float) -> (channel: int, value: float, time: float)
- class MIDIFile
Bases:
object- __init__(midiFile: str)
open file and store it as data in lists tracks with channels and track names, timesOn and off information for each track, velocity and MIDI CC info for each track, etc
- Parameters
midiFile (str) – MIDI file path
- findTrack(name)
Finds the track with a specified name
- Parameters
name (str) – The name of the track to be returned
- Return list
The track with the specified name
- getMIDITracks()
- listTrackNames()
- mergeTracks(track1: midi.MIDITrack, track2: midi.MIDITrack, name=None)
- class MIDINote
Bases:
objectMIDINote(channel: ‘int’, noteNumber: ‘int’, velocity: ‘int’, timeOn: ‘float’, timeOff: ‘float’)
- __init__(channel: int, noteNumber: int, velocity: int, timeOn: float, timeOff: float) -> (channel: int, noteNumber: int, velocity: int, timeOn: float, timeOff: float)
- class MIDITrack
Bases:
object- addAftertouch(channel: int, value: float, time: float) -> (channel: int, value: float, time: float)
add a aftertouch event
- addControlChange(control_number: int, channel: int, value: int, time: float)
add a control change value automatically checks if number has been added
- addNoteOff(channel: int, noteNumber: int, velocity: int, timeOff: float) -> (channel: int, noteNumber: int, velocity: int, timeOff: float)
adds a Note Off event
- addNoteOn(channel: int, noteNumber: int, velocity: int, timeOn: float) -> (channel: int, noteNumber: int, velocity: int, timeOn: float)
adds a Note Event
- addPitchwheel(channel: int, value: float, time: float) -> (channel: int, value: float, time: float)
add a pitchwheel event
- aftertouch: List[MIDIAnimator.data_structures.midi.MIDIEvent]
- allUsedNotes()
Returns a list of all used notes in a MIDI Track.
- Return list
a list of all used notes
- controlChange: Dict[int, List[MIDIAnimator.data_structures.midi.MIDIEvent]]
- pitchwheel: List[MIDIAnimator.data_structures.midi.MIDIEvent]
Module contents
- class BlenderObject
Bases:
objectBlenderObject(obj: ‘bpy.types.Object’, noteNumbers: ‘tuple’, noteOnCurves: ‘ObjectFCurves’, noteOffCurves: ‘ObjectFCurves’)
- __init__(obj: bpy.types.Object, noteNumbers: tuple, noteOnCurves: ObjectFCurves, noteOffCurves: ObjectFCurves)
- noteOffCurves: MIDIAnimator.data_structures.ObjectFCurves
- noteOnCurves: MIDIAnimator.data_structures.ObjectFCurves
- obj: bpy.types.Object
- rangeOff()
- Returns
start and end offsets for playing the note off curve
- rangeOn()
- Returns
start and end offsets for playing the note on curve
- class CacheInstance
Bases:
objectCacheInstance(objs: ‘List[bpy.types.Object]’) -> ‘None’
- __init__(objs: typing.List[bpy.types.Object]) -> (objs: typing.List[bpy.types.Object])
initializes a type List[bpy.types.Object] to the cache instance.
- getObject()
takes out a bpy.types.Object from the cache. This is the method to use when you want to take an object out
- Returns
the reusable bpy.types.Object
- returnObject(obj: bpy.types.Object) -> (obj: bpy.types.Object)
returns a bpy.types.Object back to the cache. This is the method to use when you are done with the object
- class FCurveProcessor
Bases:
object- __init__(obj: bpy.types.Object, fCurves: ObjectFCurves, locationObject: Optional[bpy.types.Object] = None)
- location: Optional[mathutils.Vector]
- locationObject: Optional[bpy.types.Object]
- obj: bpy.types.Object
- rotation: Optional[mathutils.Euler]
- class FrameRange
Bases:
objectthis stores an object that will be moving from startFrame to endFrame
- __init__(startFrame: int, endFrame: int, bObj: BlenderObject, type: str = 'note_on') -> (startFrame: int, endFrame: int, bObj: BlenderObject, type: str = 'note_on')
- class ObjectFCurves
Bases:
objectObjectFCurves(location: ‘Tuple[bpy.types.FCurve]’ = (), rotation: ‘Tuple[bpy.types.FCurve]’ = (), customProperties: ‘Tuple[bpy.types.FCurve]’ = (), shapeKeysDict: ‘Dict[str, List[bpy.types.FCurve, bpy.types.ShapeKey]]’ = (), shapeKeys: ‘Tuple[bpy.types.FCurve]’ = (), origLoc: ‘Vector’ = <mathutils.Vector object at 0x7f41d7b227d0>, origRot: ‘Euler’ = <mathutils.Euler object at 0x7f41d312f310>)
- __init__(location: Tuple[bpy.types.FCurve] = (), rotation: Tuple[bpy.types.FCurve] = (), customProperties: Tuple[bpy.types.FCurve] = (), shapeKeysDict: Dict[str, List[bpy.types.FCurve, bpy.types.ShapeKey]] = (), shapeKeys: Tuple[bpy.types.FCurve] = (), origLoc: Vector = <mathutils.Vector object>, origRot: Euler = <mathutils.Euler object>) -> (location: Tuple[bpy.types.FCurve] = (), rotation: Tuple[bpy.types.FCurve] = (), customProperties: Tuple[bpy.types.FCurve] = (), shapeKeysDict: Dict[str, List[bpy.types.FCurve, bpy.types.ShapeKey]] = (), shapeKeys: Tuple[bpy.types.FCurve] = (), origLoc: Vector = <mathutils.Vector object>, origRot: Euler = <mathutils.Euler object>)
- customProperties: Tuple[bpy.types.FCurve] = ()
- location: Tuple[bpy.types.FCurve] = ()
- origLoc: Vector = <mathutils.Vector object>
- origRot: Euler = <mathutils.Euler object>
- rotation: Tuple[bpy.types.FCurve] = ()
- shapeKeys: Tuple[bpy.types.FCurve] = ()