Skip to main content

Event handler with custom script (Java, python, et al)

Posted

I was thinking about this not long ago. I'd love to be able to use my Eigenharp Pico with Synfire Pro and being able to have Synfire talk to Belcanto via Synfire when events in Synfire occur - in this case particularly when I choose a chord from a palette or progression editor or by a chord change. I can't do it since Synfire doesn't have an event handler where you can run your own script (say Javascript, python, etc) to allow you to send Belcanto commands to the EigenD software which runs the Eigenharp instruments.

What I'd like to do is on a chord change (by clicking on palette, or on progression editor, or by a chord change) you can run a "script" that allows you to talk to Belcanto. When I choose say the C Minor chord, the event handler allows me to talk to Belcanto and depending on what chord is used I can do my own routine so that I can set up my chord for the Eigenharp Pico. Setting up scales would be a similar thing, using the same event handler.

Will this ever be possible? I think it would add a lot of functionality as the end user could customise the scripts for their own use, by doing what they need to do via a script (python, java,etc) when the event handler is triggered (say by a chord change).

Any ideas or suggestions or responses would be great.


Sat, 2012-04-28 - 12:04 Permalink

Would it be helpful to send out the current harmonic context (aka "Chord, Scales & Key")  via MIDI? External software could receive that and make use of it in any way it chooses. I could think of transmitting the chord, vertical scale and horizontal scale, note by note, each on a different channel.

It is certainly easier to experiment with external tools in Java, Python, Ruby, whatever (they all seem to have MIDI bindings available), than integrating a scripting engine into Synfire.

Wed, 2012-05-02 - 12:11 Permalink

Hey Andre! That would be perfect! Much easier then to just to the MIDI processing. I would agree this is much easier and more effective than a scripting engine within Synfire, and much more useful.

That way I can just write a script that would handle MIDI IN and scan the MIDI events and have options where the user can specify what time (say, 1 sec, 1/2 sec, 1/4 sec) for the scanning time once the first note on channel 1 is received, which should give the machine plenty of time to work out what the chord is.

The chord can be channel 1, the vertical scale channel 2, and the horizontal scale channel 3.

The notes would ideally be sent out as a "chord", as in, all at once, or only 5ms delay between the notes. The same would go for the scales. Best to output the notes as one, so that the response of the program I am writing for the Eigenharp can be as close to instantaneous as possible.