Jump to content

Make your own Logic Pro X MIDI Plug-ins in JavaScript!


Recommended Posts

I am pretty sure that it is javascript not java. While it does still mean programming it should be an easier entry point than java.

From the Effects manual:

 

"Use the Script Editor

The Script Editor is used to edit JavaScript code, enabling you to write your own MIDI plug-ins."

 

*** Thanks to Eric's update of the original message this makes no sense. Glad it is all cleared up!

Edited by ed
Link to comment
Share on other sites

Please - "Java" has *nothing at all* to do with *Javascript*, despite the name similarities.

 

Let's not add to the confusion. Apple say the MIDI scripter is "Javascript", so can we please always refer to the scripting language as Javascript. Can you edit the thread title, please David? Thanks...

 

Edit: Interestingly, from the docs, there is no concept of a "SysEx" event type, further echoing the evidence that sysex events are filtered out from channel strip objects, which is a bit of a shame...

 

Nice API though, looks like all sorts of fun can be had here for the nerdy types... ;)

 

Given the work involved in implementing the scripter plugin and language and javascript interpreter, it suggests to me that possibly *all* of LPX's new MIDI plugins are written with this API, rather than natively - with the others obviously having a nicely wrapped GUI as well. So the should give an idea of just some of the things that are possible, as well as more bespoke personal customisations...

 

Good stuff...

Edited by beej
Link to comment
Share on other sites

So does this mean that it will be possible to create scripts similar to the ones Kontakt has made use of for some for the nicer sample libraries ie for articulation switches etc. - assuming you set up EXS with appropriate samples to trigger.
Link to comment
Share on other sites

I'm wondering if it would be possible to make a kind of expression map with the scripter plugin.

 

Transforming 1 keyswitch to multiple keyswitch and/or midi controller seems possible. But I'm not sure we could make this with several notes.

 

I'm looking to come back from Cubase to Logic if I could have a Expression Map alternative even if it's more complex to set up. Logic have always been slicker to me but I can't live without Expression Map feature anymore.

Link to comment
Share on other sites

Would be great if a plugin could be javascripted so Ultrabeat output it's MIDI notes in realtime...**wishful thinking?

 

It's only inserted in the MIDI signal flow before any instrument plugins. So it cannot get MIDI out of instruments, like UB. The AU spec doesn't support that, or at least hasn't for a while...

Link to comment
Share on other sites

So does this mean that it will be possible to create scripts similar to the ones Kontakt has made use of for some for the nicer sample libraries ie for articulation switches etc. - assuming you set up EXS with appropriate samples to trigger.

 

Probably yes, to some degree - for instance, you could implement features like when you are holding a C0 key, the MIDI channel is changed to 1, and triggering a certain set of samples, and if you hold a D0, the MIDI channel is changed to 2 to trigger a different set of samples.

 

However, this will be limited, as there is no direct access to the EXS24 stuff, only plain vanilla MIDI. I think a better sampler solution is coming...

Link to comment
Share on other sites

Looking through the docs, I think I see the following capabilities:

 

1. Receive and examine incoming MIDI events from an external midi source or an upstream plug-in

2. Modify events

3. Create new events

4. Send modifited and/or new events downstream in real time or delayed to some future beat position.

5. Create fader and menu GUI items

6. Get initial and changed values from GUI items while processing the incoming MIDI

 

That's a fairly complete and compact set of of functions that should allow you to apply almost any conceivable transformation to incoming MIDI. I like it.

 

I can't tell the extent to which Apple may have crippled the JavaScript interpreter. Specifically, I suspect it's not possible to load external javascript libraries (although you might be able to paste the source code into your plug-in script). That could be a big hindrance to developing anything really sophisticated. It's also not clear if Apple has included a debugger in the script editor. I think they do have a syntax checker, but a real debugger would be nice to have, especially if you can't modularize the code to allow use of third-party editors and development tools. Really hope my suspicions are wrong.

 

Related but not precisely on-topic: Does anyone know if LPX has better support for AppleScript/Automator? I'd love to be able to control the transport from a script outside of Logic,. e.g. play from, say, bar 13 to bar 17, then bar 5 to bar 7, etc.

Link to comment
Share on other sites

That's a fairly complete and compact set of of functions that should allow you to apply almost any conceivable transformation to incoming MIDI. I like it.

Do you think the new Javascript MIDI plugins/spec can offer any functionality beyond what can be built in the Environment as is?

Edited by ibt
Link to comment
Share on other sites

That's a fairly complete and compact set of of functions that should allow you to apply almost any conceivable transformation to incoming MIDI. I like it.

Do you think the new Java MIDI plugins/spec can offer any functionality beyond what can be built in the Environment as is?

 

"Javascript".

 

And yes, because you have access to proper programming principles, like variables and maths and functions. Have you ever tried dividing one value by another and storing the result using fader objects in the environment..? That stuff is horrendously clunky in the environment (which is, at best, a rather simple visual programming language) but becomes trivial to do with actual code.

Link to comment
Share on other sites

"Javascript".

 

dohScript () = :oops: ;

 

So, could this open up an easier way of say, storing plug-in snapshots (pretty involved in the environment)... and also morphing between plug-in states / mixer states ?

 

Well, it's up to us to explore the possibilities. Not sure if they work with Logic's internal meta events (if they do that would be super awesome). Don't forget we can use these scripts in conjunction with other environment objects too... It's just that they are single entities (I can think of workarounds to copy variables between scripts on different channels etc) in a fixed position, which might limit things a bit, but we'll see.

 

Who knows, we might even get a "Scripter" environment object in the future, which would be *super* awesome..! :)

Link to comment
Share on other sites

Hello

 

I am also very interested of this possibility to develop the equivalent of the VST expression Map to drive VSL articulation changes

 

I have read that the score have been re-wrote ! is this true ?

 

 

Reading the manual I did not find that it was possible to convert score events (staccato, legato ...) into a midi command to be send to VSL

 

Also you cannot work on note length.

 

Looks like you cannot do more that what you can do with the environment !

 

I hope I am wrong and that this is missing in the manual

 

Best

 

Cyril

Link to comment
Share on other sites

Flexible MIDI out routing directly from AU's would have been nice. Then you could use Reaktor, Max, Plogue etc. instead. Can't really see why they they didn't go that route. What does Javascript have that makes it a better choice for MIDI out than AUs? It seems like it must have been more complex to write...

 

Thoughts?

Link to comment
Share on other sites

Flexible MIDI out routing directly from AU's would have been nice. Then you could use Reaktor, Max, Plogue etc. instead. Can't really see why they they didn't go that route.

 

Because that would require updates to the AU spec, an incorporation in a new version of OSX, before applications like Logic can take advantage of it. In short, it needs OSX support first, they can't just do it in a Logic update...

Link to comment
Share on other sites

Diving into MIDI Scripting. I've already written a few little routines and (drum roll please) they work!

 

What can be done with MIDI Scripting far outweighs what can be accomplished using environment objects alone, both in terms of function and complexity. For example, it's fairly simple (though awkward) to create the equivalent of a simple "if-then" or "if-else" function (comparator) using a transformer. For this you'd use the Condition Splitter mode, define a condition, and have all data that meets the condition output on the top cable. Everything else outputs on the bottom cable. Simple. But if you need to test for more than one condition (if A, then, if B...), the awkwardness factor of programming individual transformers increases logarithmically because you have to cascade the various transformer's outputs, and when it comes to editing their values you can only view one transformer's window at a time.

 

With Javascript, all you have to do is write a few lines of code to accomplish these tasks and the order of operations is laid out before your eyes in one window.

 

Also, it's extremely difficult to create the equivalent of variables using Environment programming. Again, with Javascript it's a piece of cake.

 

However... You can't install a MIDI Script in Logic's "front end" (inbetween the output of the Physical Input and the Sequencer Input). So scripts can't be used to process MIDI data before it's received at the Sequencer Input. This is something I hope can be addressed in a future version.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...