Coder Social home page Coder Social logo

midianimator's Introduction

Contributors Forks Stargazers Issues GNU License mido version


MIDIAnimator

Procedurally animate a MIDI file using Blender.


Explore the docs »
Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Contributing
  4. License
  5. Contact
  6. Acknowledgments

About The Project

MIDI Animator aims to provide a cohesive, open-source solution to animating instruments using a MIDI file.

Check out the technical demo:

Radiant Ensemble

(back to top)

Built With

(back to top)

Getting Started

To get started, check out the Getting Started docs page.

(back to top)

Building The Docs

  1. Clone the repository git clone https://github.com/imacj/MIDIAnimator.git and cd MIDIAnimator/docs.
  2. Run pip install -r requirements.txt.
  3. Run make html to build the HTML docs.
  4. Open index.html or run open build/html/index.html (for Mac users).
  5. Before committing, make sure you clean the build folder with make clean.

Note: Instead of reStructuredText markdown files, this project uses MyST markdown files. For some basic information on MyST markdown, visit https://myst-parser.readthedocs.io/en/v0.15.1/sphinx/intro.html and https://jupyterbook.org/en/stable/reference/cheatsheet.html.

The API docs are auto-built with sphinx-autodoc. If you want to make changes to the API documentation, please find the file you want to edit and edit the documentation string.

Please open a PR if you want to make changes to the docs.


(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the GNU General Public License (GPLv3) license.
You may freely change and add to a forked repository as you wish, but you may not publish this software as closed source.
See LICENSE.txt for more information.

(back to top)

Contact

James Alt - [email protected]

Project Link: https://github.com/imacj/MIDIAnimator

(back to top)

Acknowledgments

Here are some of the development tools I used to create this project.

(back to top)

midianimator's People

Contributors

dave256 avatar euphieeuphoria avatar jamesa08 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

midianimator's Issues

MIDIAnimator 1.0.0 beta 3 - Discussion

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.

Malformed MIDI file does not animate correctly

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

Redo backend on how animations are generated (adding Note On + Note Off, generated oscillation functions, ADSR, etc..)

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:
Image

reference curve being this:
Image

This is (sort of) the desired result, but when the graphs overlap, the keyframes should add together to produce a new composite curve.
Image

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.

tempo does not map correctly

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):

  • OS:
  • Version of MIDIAnimator (see Add-on preferences, if you have the ZIP, upload it)
  • Version of Blender (see Blender icon > About)
    all MIDIAnimator versions affected

Additional context
Archive.zip

Adding a GUI interface to N-Key Panel

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.

TypeError: object of type 'Object' has no len()

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.