Jump to content


Please note: You can easily log in to MPN using your Facebook account!

Fun with Logic/Mainstage scripts


Recommended Posts

A while ago, in a thread dedicated to alternative controllers, we discussed with Tusker the idea of writing a script able to retrigger notes (and envelopes) just with a controller like Touché (or a breath controller) for those virtual instruments that where not able to do it;

 

I finally convinced my software developer brain to work with my musician brain and after sometime dedicated to revise JavaScript, i wrote a first version of it, and we are beta testing it with Tusker; you will find it as a .txt file attached to this message.

 

Before giving some explanation about the script, a few words on myself as a software developer and on what next: i am a senior software developer, and i have a significant past in computer music: in the 90s i worked ten years in Ircam, working with Eric LIndeman on the ISPW, and with Miller Puckette (the guy behind PD) and (a bit) David Ziccarelli, and other great guys on the family of MAX languages.

I was in the jMax team, and i am the guy that resurrected it as jMax Phonenix (an open source project) in the 2000s. My day job was in serious (boring) corporate/enterprise development. In 2012 i even tryied to get my slice of the iOS music business with two applications MidiBud and MidiBlob (i can talk about them now because they are both dead since a number of years). I stopped my private software development

actvity (commercial or open source) when i realised that i got more views of my music on Youtube that downloads of the software :-). But as a software developper i am still bored, so i decided to get some fun with simple scripts development for Logic Pro and MainStage.

 

This one if the first, i have some ideas about other performance oriented scripts, and i am ready to get any suggestion, either in terms of modifications of these scripts or new one to write; use this thread for any suggestions, i'll continue to post the scripts to this thread.

 

About the first script, controllerToNote.

 

You"ll find it in attachment, as a .txt file. You need to save it, open with a text editor and copy/paste it in the Logic Pro Scripter plugin and press the Run Script button. I haven"t yet tested it on MainStage, but AFAIK it should work as it is.

 

As always, I made a number of assumptions in order to write the script and took a number of decisions based on my experience and using the BBC2 breath controller as my test controller; these two points introduce a bias in the solution.

 

But the script at the end is very simple, so it will be very easy to adapt his behaviour to other controllers if you are patient enough :).

 

So, what the script essentially does is to retrigger notes on the base of the controller behaviour.

 

1) Which notes

 

The decision was to re-trigger notes that are currently held on the keyboard (in MIDI terms, notes for which the script saw a NoteOn but not yet a NoteOff).

 

Another strategy may be used, like retriggering the last played note or chord played on the keyboard, even if it is not held; the previous choice seems musically/performance-wise more natural, but other things may be done..

 

2) How

 

NoteOff messages are sent for all the pending notes, and NoteOn are immediately reissued. So the retriggered notes will end when the keys are lifted on the keyboard.

 

3) What about note velocity

 

Note velocity currently depends only on the controller behaviour; I am not sure that this is what makes more sense, may be the original velocity should also be taken into account to allow making chords with different note velocities.

See below for details on how velocity is computed.

 

4) When

 

This is the tricky point: first naive solution was: when the controller value passes a certain threshold. The problem is, if the controller go up and stay there, are you supposed to continuously retrigger notes ?

Of course no; so it is more a stateful thing: when the controller pass the threshold, notes are retriggered and the controller is blocked from retriggering until it goes back below the threshold.

 

But in practice, this was not very responsive and natural; in many cases it was too difficult to quickly retrigger notes (for example, by tonguing on the BBC2).

 

It seemed a good idea to use also the speed of change of the controller: so, currently the script use two factors, a threshold on the value of the controller and a threshold on the speed of variation of the controller: if the controller goes up fast, the note is triggered even if the absolute value is not very high; and the two factors are also used to decide when notes can be retriggered, so if there is a percussive kind of change in the controller value, the note is can be retriggered quickly without the controller going down to zero.

There are two parameters shown in the control panel to balance this two factor; their default value match the best values I found for the BBC2, but I expect them to be very different for the Touché, for example.

 

I also used these two parameters to compute the velocity of the retriggered notes; it seemed more natural with the BBC2; there are another two parameters with as default value what I found natural.

 

The final version of the script may have a preset menu, where we can put the fine-tuning values for the different controllers.

 

5) And now ?

 

Try it, and see if it seems natural; Experiment with the four parameters, and see what it gives you.

Anything can change and evolve, the script is small and easy to change; the most difficult thing is to understand how to change it; do not hesitate to ask things.

 

I plan to write other performance-oriented scripts; the next will be an adaptive/smart MIDI delay, that try to extract the tempo from your playing.

 

One last point: being a professional software developer with a foot on the open source world, I am attentive to copyright issues with the code; this script, and all the future scripts I"ll write, state my copyright and it is released under a BSD 2 clause license; this means essentially that as long as you give credits to the authors, you can do whatever you please with it.

 

Maurizio

1937.txt

  • Like 1

Nord Wave 2, Nord Electro 6D 61,, Rameau upright,  Hammond Pro44H Melodica.

Too many Arturia, NI and AAS plugins

http://www.barbogio.org/

 

Link to comment
Share on other sites



Hey Maurizo, your contribution with this is what makes MPN a special and unique place in the internet universe. Due to lack of time I cannot participate as a beta tester, I expect the AU's I choose to use to include this feature, but what you have started here adds to the body of knowledge. Hope folks like Tusker will pick it up and run with it.
  • Like 1

A misguided plumber attempting to entertain | MainStage 3 | Axiom 61 2nd Gen | Pianoteq | B5 | XK3c | EV ZLX 12P

Link to comment
Share on other sites

Mark I agree. Creative, generous unique ideas from folks like Maurizio make this place special. Maurizio, I so appreciate your sharing your programing time and expertise with the community.

 

The script is perfect for someone pulling off strum/arpeggio patterns, or rapid multi-strikes which would be impossible on a piano or a regular keyboard. To get a similar effect, I used to have to map the same sound to multiple octaves or keyboards and do it with two hands, but this gives you a precise sound and you can take it to a different musical feel. I am using it with Touche, and it works particularly well if you are doing some delicate finger drumming. The script also worked with other controllers like pitch bend and the sustain pedal. It seems like something which would work with a number of controllers.

 

Thanks Maurizio for this gift. It"s a lovely piece of work.

Link to comment
Share on other sites

  • 1 year later...

Hi, I Am looking for the oportunity to create a simple bass while playing live with a keyboard and drums. Do you think, that this could be done with Mainstage scripting? 

My Idea was to use the MIDI in from the Keys to detect the Bass tone in realtime and to use a 2nd Bass drum trigger to trigger the bass note. So I would get a simple bassline when the bassist is absent. 

As I have the tempo + time in mainstage, this seems to be all that is needed. 

I could also immagine of other variants like bassline arppeggios that can create live 8ths or 16th that can be switched inbetween while playing via MIDI trigger. 

Do You think it is possible for live gigs? 

Thx for sharing your ideas 

 

Jan 

 

Link to comment
Share on other sites

Jan:  You don‘t provide much info to go on….  what keyboard are you using?  Does it have a sequencer?  Do you use MIDI or USB?  Could you simply record the bass as a wave file and play it back on an iPad?  Etc….  I would think you could do this with just about any sequencer (program) (or DAW program, maybe even loop it, etc…).  Do you have any other equipment or programs that you can sequence?

I accomplish exactly what you desire by simply using a bass arpeggio on my old Yamaha MOXF8, piece of cake.  Sorry, not much help, I know.

Ludwig van Beethoven:  “To play a wrong note is insignificant; to play without passion is inexcusable.”

My Rig: Yamaha MOXF8 (used mostly for acoustic piano voices); Motion Sound KP-612SX & SL-512.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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...