Results 1 to 15 of 15
  1. #1
    Member clockmender's Avatar
    Join Date
    Nov 2014
    Location
    East Leicestershire, UK
    Posts
    2,461

    Sound Bake & MIDI Sync Animations

    All done with Animation Nodes and a few base meshes, with Instances:



    I am now waiting for a MIDI Node that would read a MIDI file, create a series of controls with F-Curves derived from the MIDI notes and tracks so I can play instruments. I can do this with the old Blender 2.49 script, but this would be a great addition to AN.

    Here's a picture of two keyboards playing chords and melody using this method:

    Click image for larger version. 

Name:	Screen Shot 2017-10-02 at 08.43.14.png 
Views:	10 
Size:	666.2 KB 
ID:	500436

    I may render this, it's the first guitar solo from Comfortably Numb - I played this on my TMK88 connected through an iRig into my iMac and input into Reason DAW.

    Cheers, Clock.
    Last edited by clockmender; 03-Oct-17 at 14:08.
    K.I.S.S - a good maxim I think, and Granddads know best! No Website for now TalkTalkBusiness have screwed it up!
    My Youtube Channel (Pretty small just now...)https://www.youtube.com/channel/UCfO...1sCoG0NqZkgaAg



  2. #2
    Member clockmender's Avatar
    Join Date
    Nov 2014
    Location
    East Leicestershire, UK
    Posts
    2,461
    Update!

    I have now written a Python script that reads a MIDI CSV File - yes for now I have to convert the file to CSV format and there is a very nice little programme on the 'net to do that....

    The script examines the MIDI file and creates an empty for each note played in each track and keyframes the movement of the empty in line with when the script sees "note on" and "note off" events in the MIDI file I have tested it quite a lot, but it is still a prototype and really needs to be built into AN, or the UI, so the user can select the CSV file from their machine. I am currently testing my AN MIDI node tree on this new script's output to make sure it all hangs together.

    If anyone can point me in the right direction to build it into the UI I should be most grateful!

    Here's a screenshot of the control empties from Procul Harem's "Homburg", what I played on my TMK88 though blah, blah, blah. The selected one is the Hi-Hat (I think...).

    Click image for larger version. 

Name:	Screen Shot 2017-10-03 at 17.00.46.png 
Views:	6 
Size:	318.3 KB 
ID:	500635

    and a bit of the MIDI CSV File:

    Click image for larger version. 

Name:	Screen Shot 2017-10-03 at 17.02.46.png 
Views:	6 
Size:	85.6 KB 
ID:	500636

    Cheers, Clock.
    K.I.S.S - a good maxim I think, and Granddads know best! No Website for now TalkTalkBusiness have screwed it up!
    My Youtube Channel (Pretty small just now...)https://www.youtube.com/channel/UCfO...1sCoG0NqZkgaAg



  3. #3
    Member
    Join Date
    Aug 2012
    Location
    Arizona
    Posts
    304
    Awesome work @clockmender I'm looking forward to see where this goes and hope that some musically inclined Blender artists join your efforts to bring a midi-sync signal to generative animation!!!
    Lost in the voltage of a Eurorack patch gone mad. http://www.johnwise.com



  4. #4
    Member
    Join Date
    Jun 2011
    Location
    Sydney, Australia
    Posts
    511
    Do you have the Python script that converts the MIDI into CSV? I want to give it a try with Sonic Pi 3 and AN!



  5. #5
    Member clockmender's Avatar
    Join Date
    Nov 2014
    Location
    East Leicestershire, UK
    Posts
    2,461
    Originally Posted by enzyme69 View Post
    Do you have the Python script that converts the MIDI into CSV? I want to give it a try with Sonic Pi 3 and AN!
    I think it is written in C++? you can find it here:

    http://www.fourmilab.ch/webtools/midicsv/

    It works well for me and produces a clean file that Python can read easily and quickly - being a CSV file you can easily see the structure of the events in the MIDI file. Writing a script to read the generic MIDI file will probably be a huge pain in the ass, whereas Python reading the CSV file is easy, with not very much code. My script made and keyframed a multi channel CSV file with 102 separate control empties, total song length 6350 frames at 24fps in under 2 seconds...

    Cheers, Clock.

    EDIT:

    @JWise - thanks for the kind comments sir! - hopefully there will be enough interest to get this project really moving.
    Last edited by clockmender; 04-Oct-17 at 11:34.
    K.I.S.S - a good maxim I think, and Granddads know best! No Website for now TalkTalkBusiness have screwed it up!
    My Youtube Channel (Pretty small just now...)https://www.youtube.com/channel/UCfO...1sCoG0NqZkgaAg



  6. #6
    Member clockmender's Avatar
    Join Date
    Nov 2014
    Location
    East Leicestershire, UK
    Posts
    2,461
    Update:

    OK, so I have now got the script to:

    1) Read and action the note velocity as well as just note-on, note-off.

    2) Read and action the Header information, Tempo, Channel Names and PPQN (Pulses per Quarter-Note). it makes up channel names if they do not have a channel "Title".

    3) Calculate Beats Per Minute (BPM) and bar length.

    4) Have a variable, user defined "easing" to slope the F-Curves so the piano keys (for example) don't just bang down,

    5) Take care of the situation where a note is played immediately after another play - so the timings for Note-off[event-1] and Note-on[event-2] may be the same - this caused Blender to mess up the F-curves, so I sorted that out....

    6) Create the Group names for the controls, so they can be fed straight into the AN Node Tree.

    7) Set the frames precisely so the end of the MIDI sequence is exactly in line with the Sound - well to the nearest 0.0001 or a frame anyway.

    I am going to keep testing with ever more complex midi files to see if I can break it. the nest step is to vary the tempo (and therefore BPM) throughout the MIDI file and action this in the animation. The PPQN won't change but the Pulse time per Quarter-Note will (130bpm = 461538 micro-seconds / quarter note as a "for instance") Any tempo changes are stored in the MIDI where they occur, so I should be able to read this and adjust the frame translation from the MIDI pulse value.

    Cheers, Clock.
    K.I.S.S - a good maxim I think, and Granddads know best! No Website for now TalkTalkBusiness have screwed it up!
    My Youtube Channel (Pretty small just now...)https://www.youtube.com/channel/UCfO...1sCoG0NqZkgaAg



  7. #7
    Member clockmender's Avatar
    Join Date
    Nov 2014
    Location
    East Leicestershire, UK
    Posts
    2,461
    Update:

    Opps - Youtube screwed up my video....

    I'll try again later.

    Cheers, Clock.
    Last edited by clockmender; 06-Oct-17 at 11:33.



  8. #8
    Member clockmender's Avatar
    Join Date
    Nov 2014
    Location
    East Leicestershire, UK
    Posts
    2,461
    OK, here is a video for review:



    Let me know what you think to this please.

    Cheers, Clock.
    Last edited by clockmender; 08-Oct-17 at 07:08.
    K.I.S.S - a good maxim I think, and Granddads know best! No Website for now TalkTalkBusiness have screwed it up!
    My Youtube Channel (Pretty small just now...)https://www.youtube.com/channel/UCfO...1sCoG0NqZkgaAg



  9. #9
    Member clockmender's Avatar
    Join Date
    Nov 2014
    Location
    East Leicestershire, UK
    Posts
    2,461
    Here's an example of a set of controls built by the script:

    Click image for larger version. 

Name:	Screen Shot 2017-10-08 at 18.25.06.png 
Views:	5 
Size:	377.4 KB 
ID:	501129

    I have changed the "Empty Draw Type" to "Single Arrow" and checked on the "Display Name" for each empty (all done in the script) You should also be able to see the Group Name - "Channel_2" for the selected empty. The MIDI file did not have Channel Names, so I add these in the script using "Channel_" plus the MIDI channel number, otherwise it takes it's name from the MIDI file.

    The top set are the drums, the "missing" lines are controllers, that we do not need to animate the keys. You can also see a section of the F-Curve for the selected control - this has near vertical sides as the notes are very short in the MIDI file, particularly for the drums. Longer notes means I can use a larger "easing" values to slope the sides of the F-Curve a little more. You can also see that the Keyframes are not on an integer frame number - you can do this in Python, but not in the UI, or should I say I haven't found a way to do it in the UI yet....

    So now I have got all the various bits working, now for some serious testing on many MIDI files to try and break it.

    Hope all this makes sense. I am going to try to build the script into an Animation Node, with Input boxes for all the parameters in the script - this I have never done before so it may take some time.

    Cheers, Clock.
    K.I.S.S - a good maxim I think, and Granddads know best! No Website for now TalkTalkBusiness have screwed it up!
    My Youtube Channel (Pretty small just now...)https://www.youtube.com/channel/UCfO...1sCoG0NqZkgaAg



  10. #10
    Member clockmender's Avatar
    Join Date
    Nov 2014
    Location
    East Leicestershire, UK
    Posts
    2,461
    I am really struggling to make a new node with my script in it...

    I think it is going to take a while to get my head around what is allowed and what causes Blender to kick AN into touch.

    Has anyone got any pointers, has anyone done this before? Help gratefully received.

    Cheers, Clock.
    K.I.S.S - a good maxim I think, and Granddads know best! No Website for now TalkTalkBusiness have screwed it up!
    My Youtube Channel (Pretty small just now...)https://www.youtube.com/channel/UCfO...1sCoG0NqZkgaAg



  11. #11
    Member clockmender's Avatar
    Join Date
    Nov 2014
    Location
    East Leicestershire, UK
    Posts
    2,461
    Eureka!!!!

    Click image for larger version. 

Name:	Screen Shot 2017-10-16 at 17.47.29.png 
Views:	4 
Size:	318.4 KB 
ID:	501984

    I have made a Node - that creates controls with F-Curves derived from a CSV format MIDI file, I am very pleased with myself.

    I will continue testing and error trapping before I declare it "Fit for peer testing", thence onto "Fit for purpose".

    Cheers, Clock.
    K.I.S.S - a good maxim I think, and Granddads know best! No Website for now TalkTalkBusiness have screwed it up!
    My Youtube Channel (Pretty small just now...)https://www.youtube.com/channel/UCfO...1sCoG0NqZkgaAg



  12. #12
    Member minoribus's Avatar
    Join Date
    Feb 2013
    Location
    Germany
    Posts
    3,291
    I think I said some time ago that you are doing wizardry here and I can only repeat that Awesome advanced stuff. Keep it up!



  13. #13
    Member clockmender's Avatar
    Join Date
    Nov 2014
    Location
    East Leicestershire, UK
    Posts
    2,461
    Why thank you - I am building a new node to calculate the indices as a one-off operation... may take some time as I haven't a clue what I am doing.

    Cheers, Clock.
    K.I.S.S - a good maxim I think, and Granddads know best! No Website for now TalkTalkBusiness have screwed it up!
    My Youtube Channel (Pretty small just now...)https://www.youtube.com/channel/UCfO...1sCoG0NqZkgaAg



  14. #14
    Member clockmender's Avatar
    Join Date
    Nov 2014
    Location
    East Leicestershire, UK
    Posts
    2,461
    Originally Posted by clockmender View Post
    Why thank you - I am building a new node to calculate the indices as a one-off operation... may take some time as I haven't a clue what I am doing.

    Cheers, Clock.
    OK, so now with a great deal of help from Jacques I have made this new node. To get it to only execute once in the project, I have put it in a new node tree and used Group Nodes to pass the index file from tree to tree:

    Click image for larger version. 

Name:	Screen Shot 2017-10-18 at 11.12.37.png 
Views:	1 
Size:	73.8 KB 
ID:	502115

    And the animation Node Tree (or part thereof):

    Click image for larger version. 

Name:	Screen Shot 2017-10-18 at 11.13.00.png 
Views:	1 
Size:	103.0 KB 
ID:	502116

    Cheers, Clock.
    K.I.S.S - a good maxim I think, and Granddads know best! No Website for now TalkTalkBusiness have screwed it up!
    My Youtube Channel (Pretty small just now...)https://www.youtube.com/channel/UCfO...1sCoG0NqZkgaAg



  15. #15
    Member clockmender's Avatar
    Join Date
    Nov 2014
    Location
    East Leicestershire, UK
    Posts
    2,461

    The "Rude Band" Plays for the First Time!

    So here is my latest project:

    Click image for larger version. 

Name:	rude-band-1.png 
Views:	1 
Size:	570.0 KB 
ID:	502129

    And a closer view:

    Click image for larger version. 

Name:	rude-band-2.png 
Views:	1 
Size:	816.7 KB 
ID:	502128

    They all "gesture" to the tune "The Entertainer" by Scott Joplin, each puppet represents a note on the piano and they are arranged in Octave Sets rising from the lower tier, note C on the right as they stand, B on the left. I must apologise to the late Mr. Joplin for this project!

    I wil render it to a video, once I can stop laughing and transfer it to my server for processing.

    Cheers, Clock.

    PS. Seriously - I can now animate almost anything using my new MIDI Nodes.
    Last edited by clockmender; 18-Oct-17 at 08:34.
    K.I.S.S - a good maxim I think, and Granddads know best! No Website for now TalkTalkBusiness have screwed it up!
    My Youtube Channel (Pretty small just now...)https://www.youtube.com/channel/UCfO...1sCoG0NqZkgaAg



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •