jamesa08 / midianimator Goto Github PK
View Code? Open in Web Editor NEWProcedurally animate a MIDI file using Blender.
License: GNU General Public License v3.0
Procedurally animate a MIDI file using Blender.
License: GNU General Public License v3.0
probably just Hi-Hat animation for now- more in the future.
One major disadvantage over the current result is the number of keyframes (points) on the graph. I want a more systematic approach instead of evaluating and adding each current FCurve and keyframing it to the target each frame (the current method for all evaluations in MIDIAniamtor).
I'm trying to develop an algorithm that will take the note on and note off FCurves for an object and create a composite curve, similar to how MIDIAnimator works now, only with Note On support.
The current evaluation method:
This is (sort of) the desired result, but when the graphs overlap, the keyframes should add together to produce a new composite curve.
I'm looking for some more input and knowledge on how to do this. Specifically how to take lists of keyframes and combine them together to make composite curves as shown in the first image.
Hello!
I am very excited to announce the first release of MIDIAnimator! Documentation can be found here: https://midianimatordocs.readthedocs.io/en/latest/
Please feel free to open issues/discussions if you find problems and/or having trouble using it. I'd also like to gauge feedback on what things feel clunky, what things work/don't work, etc... Your feedback is key for the growth of this tool.
Also feel free to reach out via email - [email protected].
Originally posted by @jamesa08 in #4
Feel free to reply to this thread if you run into issues.
Error:
AttributeError: 'MIDIEvent' object has no attribute 'timeOn'. Did you mean: 'time'?
Describe the bug
setup evaluated & keyframed instrument with note on and note off FCurves- pressing execute on script will produce traceback:
Error: Python: Traceback (most recent call last):
File "/Users/james/Downloads/HL_Laser_Test (1).blend/MidiAnimator.py", line 9, in <module>
File "/Users/james/Library/Application Support/Blender/3.4/scripts/addons/MIDIAnimator/src/animation.py", line 53, in addInstrument
raise e
File "/Users/james/Library/Application Support/Blender/3.4/scripts/addons/MIDIAnimator/src/animation.py", line 50, in addInstrument
cls = instrumentCls(midiTrack, objectCollection)
File "/Users/james/Library/Application Support/Blender/3.4/scripts/addons/MIDIAnimator/src/instruments.py", line 433, in __init__
self.preAnimate()
File "/Users/james/Library/Application Support/Blender/3.4/scripts/addons/MIDIAnimator/src/instruments.py", line 630, in preAnimate
if not validateFCurves(obj.midi.note_on_curve, obj.midi.note_off_curve):
File "/Users/james/Library/Application Support/Blender/3.4/scripts/addons/MIDIAnimator/utils/blender.py", line 59, in validateFCurves
if (len(noteOnFCurves) == 0 and bool(noteOffFCurves) is False) or (len(noteOffFCurves) == 0 and bool(noteOnFCurves is False)): return True
TypeError: object of type 'Object' has no len()
Expected behavior
A clear and concise description of what you expected to happen.
i expect it to work, not crash
Screenshots
If applicable, add screenshots to help explain your problem.
Information (please complete the following information):
MIDIAnimator - INFO - MIDIAnimator registered successfully
MIDIAnimator - INFO - MIDIAnimator version 1.0.0 beta4.0.
MIDIAnimator - WARNING - The `instrumentType` parameter has been depercated and is no longer required.
MIDIAnimator - ERROR - Error while creating instrument: 'object of type 'Object' has no len()'
Traceback (most recent call last):
File "/Users/james/Library/Application Support/Blender/3.4/scripts/addons/MIDIAnimator/src/animation.py", line 50, in addInstrument
cls = instrumentCls(midiTrack, objectCollection)
File "/Users/james/Library/Application Support/Blender/3.4/scripts/addons/MIDIAnimator/src/instruments.py", line 433, in __init__
self.preAnimate()
File "/Users/james/Library/Application Support/Blender/3.4/scripts/addons/MIDIAnimator/src/instruments.py", line 630, in preAnimate
if not validateFCurves(obj.midi.note_on_curve, obj.midi.note_off_curve):
File "/Users/james/Library/Application Support/Blender/3.4/scripts/addons/MIDIAnimator/utils/blender.py", line 59, in validateFCurves
if (len(noteOnFCurves) == 0 and bool(noteOffFCurves) is False) or (len(noteOffFCurves) == 0 and bool(noteOnFCurves is False)): return True
TypeError: object of type 'Object' has no len()
#-#-#-#-#-# SYSTEM SPECS #-#-#-#-#-#
MIDIAnimator version 1.0.0 beta4.0.
Blender version 3.4.0.
Python version 3.10.8.
OS: macOS-12.6.5-arm64-arm-64bit.
System: Darwin.
Version: Darwin Kernel Version 21.6.0: Thu Mar 9 20:12:21 PST 2023; root:xnu-8020.240.18.700.8~1/RELEASE_ARM64_T6000.
Additional context
from CrappyPastry99 in Discord
Describe the bug
MIDIAnimator cannot read the tempo correctly from this malformed MIDI file, which reports itself as a type 1 when in fact it is a type 2 MIDI file, having tempo defined for each track. This works fine in beta 4.0, but if the tracks had different tempos, this wouldn't work correctly. This will be okay for now
To Reproduce
Load up a blank template scene
Drop the MIDI file and animate with beta 3.3
Tempo is misaligned, due to the malformed MIDI file.
beta 4.0 as of commit 29f4576 is working correctly
Expected behavior
The animation should be synced
Describe the bug
tempo does not map correctly. For instance, the tempo in this file does not line up with the animation
To Reproduce
execute the MIDI file below with a simple setup
Expected behavior
A clear and concise description of what you expected to happen.
animation should line up with the audio
Screenshots
If applicable, add screenshots to help explain your problem.
Information (please complete the following information):
Additional context
Archive.zip
Describe your feature/proposed changes
Add a GUI interface to the N-Key panel
This will encompass generating execution code via the options selected in the menu. This needs to also sync with features already implemented, and as new items get added, the GUI will adjust accordingly (i.e., a new instrument gets added, and it will also get added to the GUI interface.)
Flowcharts will be added later proposing data flow, and mockups in Paint or Photoshop will be done to mock the interface.
@virtualturtle - I will want your help with mocking the interface layout using Blender's GUI after I create the flow charts.
Ideas to make this happen:
JSON files to read in already-implemented instruments
I think we will use these to add instruments.
Additional context
Add any other context or screenshots about the feature request here.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.