MIDI on Blender

Is it possible to trigger animations from a MIDI track? Does Blender have support for MIDI files?

1 Like

People have created addons that do this… welcome to the forum! I recomend a little Google research into “blender midi” … you can hopefully find addons and tutorials and example files that will help with your project.

1 Like

This idiot has done one, you can find it here: https://github.com/Clockmender/Clockworx-Music

It’s not fully developed yet but works fine, or so he says!

Animation Nodes now has MIDI nodes as well: http://docs.animation-nodes.com/tutorials/midi/

What exactly did you want to do? Let us know and we can help a bit more, there are some videos on my Vimeo and YouTube channels, “Clock M Ender” on YouTube, “Clockmender” on Vimeo. There’s also this thread here: Sound Bake & MIDI Sync Animations

There’s also this on DevTalk: https://devtalk.blender.org/t/clockworx-music-nodes-some-issues-to-solve/11845

That should keep you busy for a while!

Cheers, Clock.

3 Likes

Hello friends, thank you for welcoming the forum and for responding so soon.

Clockmender, let me tell you a bit. I am a music teacher (I do not know Blender, but I can learn it quickly) and I need to generate an audiovisual material called “musicograma” in Spanish. It is the graphic representation of rhythms that students have to see and imitate. For that, I take any song, and record 2 midi tracks on it (which will be the rhythms that they have to imitate). Those rhythms have to be represented graphically, so that learning is easy. Here it is exemplified: EXAMPLE OF MUSICOGRAMA

Recording the midi tracks is not difficult at all. But graphing rhythm can be very laborious in a video editor. And since the information on which hits go at what times already exists in the midi tracks, I think it is possible to create a template in Blender that reads those midi and can quickly generate the visualization.

I have to do at least 50 songs, for the entire school year. I am willing to work with someone for it and pay for their work.

Any help would be of great use to me. Greetings and merry christmas!

OK so here is a typical setup using Clockworx Music Nodes to animate from a MIDI file:

Producing these control Empties takes a matter of seconds per MIDI track in the file, one of these is the Drums btw. These controls can then be used to animate anything you like, so quite often I use them to drive a keyboard, or other such objects. Its a quick and easy process, the only proviso is that you must convert the MIDI file to .csv format and there are loads of free programmes to do this as shown on my GitHub page I referenced earlier.

Then the Animations can be made, I quite often just use 3D models of instruments, but there is no reason why any objects of any nature can’t be used. So this one just uses Shapekeys on an Object to show the drums:

This one was made from the same MIDI file used in the top image, just linked to various objects to animate them, the magenta cylinders are driven by the drum channel:

Just some of what can be done. You will need to get used to basic modelling in Blender first tho!

Cheers, Clock.

2 Likes

Ok friend, infinite thanks.

I will start by getting to know the Blender environment and then go to what I need specifically. Can I ask you something again if I need it?

Greetings from San Miguel, Santiago de Chile!

Of course you can, that is what I and others are here for!

Give my regards to Santiago! I was there just before Covid in late 2019 on my way down to Antarctica to play with the penguins and seals. Also visited the Atacama dessert, the lakes district to the south of Santiago near Puerto Varas and Punta Arenas! Loved it all!

If you look on this page of my website, you can see some pics from my journey in amongst other frivolity…

Cheers, Clock.

1 Like

Best of luck!

3 Likes

Thank you. Calpgrmr, I’m getting into Blender little by little, and it has been very nice.

Clockmender, I need help. I have the error “No module called pygame”.

I understand that on Github you comment how to do this. The thing is, I don’t know where I should do it, I don’t know how to do it either. Is it in the Blender console? I would really appreciate it.

By the way, you know more places in Chile than I do! Kind regards.

OK, the latest version from my GitHub automatically loads the PyGame module for you. So you need to go here: https://github.com/Clockmender/Clockworx-Music/tree/Blender-2.9-3-12-21

if you are on Blender 2.9, or here: if you are on Blender 3.0: https://github.com/Clockmender/Clockworx-Music/tree/Blender-3.0

And get the repo on your machine, then zip up the clockworx-music folder and load that as your Add-on. This is important, or it won’t work.

The method described previously on my GitHub is no longer needed, so I guess something has gone wrong… Can I ask you to find the __init__.py file in your add-ons location, it should look like this at the top:

# Load PyGame Module if not present in BLender Python
import subprocess
import sys

try:
    import pip
except ImportError:
    subprocess.check_call([sys.executable, "-m", "ensurepip"])
try:
    import pygame as pg
except ImportError:
    subprocess.check_call([sys.executable, "-m", "pip", "install", 'pygame'])
finally:
    import pygame as pg
# End Import Pygame

from lines 63 to 77.

If you can find that file, we can solve the issue… What operating system are you? If you download a new version, you need to remove the old add-on.

Cheers, Clock.

EDIT: If you do this manually, you do it in a terminal, not the Blender Console…

if you are still struggling send me a Private Message here with your email and I’ll send you a zip file if you tell me your Blender version number.

Thanks amigo. I will send you a private message.