5

Nerdy question: Does Logic Pro supply any sort of API which allows me to traverse track, check if they send MIDI out and if so, spit out a list of the notes on those tracks ?

If not, is there any clever way to automate that (get a list of the midi notes for a track) ?

George Profenza
  • 153
  • 1
  • 5
  • As far as I know the most low-level access to Logic workings is possible via Environment, which is a kind of limited visual programming system. I'm not sure what are you trying to achieve in the end but it may help you. –  Nov 01 '12 at 02:27
  • @AntonStrogonoff Thanks, where can I learn more about Environment ? – George Profenza Nov 01 '12 at 03:02
  • http://audio.tutsplus.com/tutorials/recording/understanding-logic-pros-environment/ will probably explain the basics. If you tell us what you are trying to achieve with the list of midi notes though, maybe someone could say whether Environment can do that or not. –  Nov 01 '12 at 03:43
  • I see.I was working on a project that involved controlling mulitiple(40+) DIY instruments based on a audio track: had to map MIDI to DMX essentially. I ended up making a quick Max patcher which worked out. I was wondering if there was a built-in scripting language in Logic to traverse the session and export the data in a custom text format, but now that I think of it it's kind of the same as exporting MIDI files which can be parsed later.The advantage of having Logic talk directly/live to the instruments via Max is that we could easily update/tweak the track without 're-exporting' all the time – George Profenza Nov 03 '12 at 10:15
  • Right, I should've thought about Max when you mentioned scripting. By the way, sounds like an interesting project. =) Do you do that live with Logic? We're trying to develop setup for mixed video/audio performance as well, though video part is going to be Resolume-driven. Not sure if Logic is reliable enough for live audio part. Max is likely to be involved though. –  Nov 04 '12 at 07:53
  • We did that live with Logic and it worked pretty well. I used a single MIDI bus on each side(Logic and Max) to make sure we don't accidentally get flooded from anywhere else first. At some point we had to display video with some animations and text overlayed . Initially I was doing that procedurally using Jitter's qt.movie and qt.lcd, but then realized we need a patcher as simple and as fast as possible to minimize delays so ended up with a really basic patch that does two things: converts MIDI data(note, velocity and channel) to DMX(channel and intensity/value) and plays a prerendered .mov – George Profenza Nov 05 '12 at 10:15
  • This was Logic sending MIDI Out and Max receiving. In July I was involved with another project where I was doing some basic computer vision and based on movement I was sending MIDI notes to Logic (and OpenFramworks,OpenCV app sending MIDI to Logic essentially). After we've done the basic tests first to make sure what's sent on one end and received on the other reliably (without much delay, duplication, errors, etc.) things worked out pretty good. – George Profenza Nov 05 '12 at 10:18
  • Thank you for response, and mentioning OpenCV. Using simple input from visual sensors (not sure if it's going to be much of ‘computer vision’ =)) is something we're also aiming to try. –  Nov 05 '12 at 11:57
  • This is pretty hard-core and definitely would be more trouble than it's worth given your goal, but still, it's cool to know that it's possible to actually hack Logic to behave a different way, see this link: http://www.logicprohelp.com/forum/viewtopic.php?t=14808

    It was accomplished using a plugin called SIMBL that makes it possible to change the functionality of a running app. TotalFinder (http://totalfinder.binaryage.com/) uses this technique as well to add tabs to the Finder.

    –  Feb 25 '13 at 21:15

1 Answers1

4

I'm not sure how deep AppleScript support in Logic is, but that would be the first place to check.

If AppleScript won't do it, then you might try just directly processing MIDI. If you don't need results in real time, then it is easy. Just code up a MIDI processor using your favorite language and library (easy libraries exist for perl and Python. I suspect that good libraries exist for Java, Ruby and other popular languages). You can save individual tracks as MIDI and process them.

Alternately, you can use the Apple IAC bus to create a virtual port. Send MIDI notes from Logic to this port, and then listen to that port with your script. You could setup a second IAC bus to send processed data back to Logic, but be careful of infinite MIDI loops.

ObscureRobot
  • 4,380
  • 11
  • 20