Forum rss-feed

Forum

Developers: Prototype open-source OSC EigenD agent available

STICKY

written by: geert

Hi everyone,

Given the current developer interest and barnone's motivation to dig into the code, Jim has spent some time creating a prototype EigenD agent that is able to output EigenD data streams directly through OSC.

This implementation is just a start and was quickly written in two days to bootstrap the learning process of users that wish to participate in the development. Its serves both as a documented example for creating agents as well as an initial step towards the OSC plans that we've been making. As time progresses, our OSC support will mature and the EigenD OSC protocol will be formalized in more detail, but this should give you an idea of the direction we're heading into. We've discussed various approaches towards how to handle the OSC representation over the network and have hit limitations of the network stack in the past due to the massive amount of performance data that the Eigenharp generates. This performance data is essential to the expressiveness of the Eigenharp and we obviously want to allow it to be exposed in as much detail as possible. The document named "OSC" that comes with this example agent briefly explains what we consider the best approach, it will mature as we further work on the OSC support.

The document named 'Roadmap' explains how to use this OSC agent and gives a high-level developer-centric explanation of EigenD's internal architecture. The source code is heavily documented and should make it easy to adapt towards any other functionalities that you might want to implement with an agent.

The source code can be found on GitHub in the 1.4 branch of EigenD. Here is a direct link towards the source of just the plg_osc agent:
https://github.com/Eigenlabs/EigenD/tree/1.4/plg_osc

More information about getting involved in EigenD development can be found on this wiki page:
http://www.eigenlabs.com/wiki/Developers/

Please realize that we have very limited resources to provide direct support to external developers as we're hard at work wrapping up the initial release of EigenD 2.0 and Workbench. We hope that this example will give you enough information to make EigenD development more accessible.

Take care,

Geert

written by: barnone

Sat, 19 Nov 2011 21:42:11 +0000 GMT

Regarding these issues
a.) You need to run EigenD from inside the .app package otherwise I think it can't find all it's resources. You should see a menu. Are you running it like this?
./tmp/app/EigenD.app/Contents/MacOS/EigenD --stdout --noauto

b.) Yeah it can only run from the Tools menu of EigenD

c.) See a.)

Starting with --noauto flag makes sure that EigenD starts as a blank slate. Or you can set "blank" as the default setup now in EigenD.

If the above things don't work, you can always run the 1.4.8 release and send it commands instead, the osc agent is now part of 1.4.8 proper.


written by: dhjdhj

Sat, 19 Nov 2011 23:22:13 +0000 GMT

Arrrggg --- you mean I needn't have bothered trying to build my own system and could have just used 1.4.8 all along? Bummer.

I was not able to run from within the app package --- and when I looked inside it, not only was the alias wrong, but the resources subfolder was empty.


So I was running it from the command line (although without the -noauto).


I just looked inside the 1.4.8-testing and I see there is indeed an osc_output plugin.

I would really appreciate it if someone could feed me the exact steps to just create a fresh blank setup that just has the osc in it.

Finally, I noticed as I was looking at the OSC output through Max, nothing seems to get generated if I slide my finger on the ribbon. I didn't try the breath control either. How are those transducers supposed to come through OSC?

By the way, thanks for the continued responses this afternoon, really appreciated them and very pleased to have this up and running....


written by: barnone

Sun, 20 Nov 2011 00:25:44 +0000 GMT

Yeah the Resources folder should be empty in the app packege. Maybe this problem is related to not having a release version of EigenD installed on your machine? Wasn't there some dependencies on this?

The strips don't seem to be connected. The breath pipe is however.

You should be able to run 1.4.8 and either use the ./brpc tool from your build or use straight belcanto in EigenCommander.

So

1. Startup 1.4.8. It's best to startup with blank setup as default
2 Open EigenCommander
3. Use Belcanto like so
osc output create
alpha manager create
alpha keyboard 1 hey ("This is just to make sure Alpha is connected")
alpha keyboard 1 to osc output 1
connect

NOTE: For some reason I need to execute "connect" as a separate final command. Then everything is hooked up and ready to go.


written by: dhjdhj

Sun, 20 Nov 2011 02:11:24 +0000 GMT

Thank you ---- I will try this later tonight --- very excited to now be close to having an environment that I can completely control from Max.

Again, I appreciate the help.


written by: dhjdhj

Sun, 20 Nov 2011 02:12:15 +0000 GMT

By the way, I do have the release version on the machine where I was actually running my tests.


written by: barnone

Sun, 20 Nov 2011 02:15:34 +0000 GMT

@dhjdhj
You're welcome. I'm really happy you've got your setup connected.


written by: dhjdhj

Sun, 20 Nov 2011 14:37:41 +0000 GMT

If I load a blank patch and then follow your belcanto instructions, I get the same failures as I was seeing earlier.

See picture Belcanto script failure


written by: NothanUmber

Sun, 20 Nov 2011 14:48:43 +0000 GMT

Hm, what is this "alpha keyboard 1 hey" good for?
Just tried the following with my Tau, worked out of the box:


osc output create
alpha manager create
plumber hey tau keyboard 1 to osc output 1 connect

So if you exchange "tau" with "alpha" chances are good that is works on your side, too :)


written by: barnone

Sun, 20 Nov 2011 17:01:01 +0000 GMT

Yes indeed, that's what I forgot, the plumber.

keyboard 1 hey just verifies that the Alpha is connected. However it is strange that dhjdhj's alpha keyboard 1 hey failed. You may have to pause a few secs after alpha manger create to allow it to connect.

I tried the steps above from NothanUmber and they work for me.


written by: dhjdhj

Sun, 20 Nov 2011 23:51:33 +0000 GMT

Well, I'm still struggling with getting an empty setup to work but I've just left it with my existing setup for now and I have the OSC stuff working well.

The format of the incoming OSC seems a bit funky (there's no key information in the message when you release a note) so I ended up with a bit of a hacks patcher in Max to handle it. I wonder if this is going to be changed.

But at this point I'm able to extract info, use Max to create scale definitions (e.g. I have patchers to setup chromatic scales, major or minor, guitar tuning) and then feed info into my Live Rig toolbox. Works very nicely.


written by: barnone

Mon, 21 Nov 2011 00:16:13 +0000 GMT

As far as the format of the OSC message.

/keyboard_1/key/5 siffff "44" 43 2.000000 0.054688 -0.016602 -0.007812

The 5 here /keyboard_1/key/5 is the number of an event stream. This number stays the same for the event from first key press to release. That is the number you need to coorelate with the end event, not the key number. The event streams are round robined and the numbers are reused. If more streams are needed, then the pool of them grows.

Did you open my MAX patch? It deals with these event streams properly I think, and it's quite visual as there is a pool of 25 channels for the streams and you can see each one pick up a new event stream and handle it until the key up.

They did say this was RAW data, so it organized along the lines of how eigenD deals with events. I'm guessing that the channelization allows for more efficient processing and allows new events to have minimum latency if you think of each event stream being a queue that is being serviced.



written by: dhjdhj

Mon, 21 Nov 2011 01:05:37 +0000 GMT

Yeah, I knew the 5 (in your example) was the event stream but I was getting bogged down when trying to track them that way because the [coll] object generates no output if an item is not found, which is a pain....I kept coming up with hacks none of which I liked.

I saw a graphic of your Max patch somewhere but I didn't notice a version I could download. Where did you post it?


written by: barnone

Mon, 21 Nov 2011 01:12:36 +0000 GMT

It right here

EigenCV Patch

It requires installing osc_route external from CNMAT. Here
Osc route

There is a bug in MAX regarding empty strings in messages being persisted when patch is saved, you need to read the NOTE with the red panel behind it. Would love to know a fix for that.


written by: geert

Mon, 21 Nov 2011 06:53:38 +0000 GMT

Skimming through the latest messages, I just want to clarify something about Belcanto. The commands you give it are based around a conversation model, it might serve you well to read this introduction: http://www.eigenlabs.com/wiki/1.3/The_Belcanto_Introduction/

The following commands are not supposed to work:
alpha keyboard 1 hey
alpha keyboard 1 to osc output 1
connect

Since after 'alpha keyboard 1 hey', the alpha keyboard 1 agent is waiting for a sentence, in which connect will be the verb. However, the alpha keyboard 1 agent doesn't understand that verb, the plumber agent does instead.


written by: geert

Mon, 21 Nov 2011 07:02:42 +0000 GMT

Also, about the raw format, there are very good reasons for the data streams. It basically turns an electronic device into a real expressive instrument, not being tied to the percussive note/velocity model of MIDI where everything is just separated in channels. Just as with any real world instrument, something generates some kind of an impulse (which is a data stream), multiple impulses can come and go at any time, be joined together and combined to create difference in expressiveness. The key is here that this needs to all be in the hands of the musicians and not 'automated' as is done in so many virtual MIDI instruments nowadays. Being able to feel this direct connection and interact with it at any time, is part of what the Eigenharp brings to the table in terms of new capabilities in electronic music, it's also the reason why it doesn't limit itself to MIDI at the USB connection. We sincerely hope that in the coming years, people will more and more realize how limited MIDI is and move to a more suitable model.


written by: dhjdhj

Mon, 21 Nov 2011 23:02:31 +0000 GMT

So what exactly is the command sequence to send to a blank setup?

I have MaxMSP working beautifully now with the raw OSC but I am still letting the Eigenharp load my default guitar profile although of course that information is just ignored.

I now have some basic Eigenharp control patchers that get loaded along with other keyboard routing patchers and so my Alpha is now integrating nicely with the rest of my environment......very exciting (at least for me).


----------
The following commands are not supposed to work


written by: geert

Mon, 21 Nov 2011 23:19:18 +0000 GMT

Those that are documented in the Roadmap file in the osc_plg agent directory, adapted for the Alpha:
osc output create
alpha manager create
alpha keyboard 1 to osc output 1 connect

Wait a few seconds after creating the alpha manager for the keyboard to be able to be detected.


written by: NothanUmber

Tue, 22 Nov 2011 00:09:16 +0000 GMT

Perhaps dhjdhj's problem is that the interpreter does not connect to the EigenCommander? (It's easy to overlook, in this case you see a red bulb in the lower right). I always have this behaviour if I choose the blank setup as default - presumably it's so "blank" that it doesn't even contain the interpreter? If you load an arbitrary non-blank setup first and then go to the blank one it usually works.


written by: dhjdhj

Tue, 22 Nov 2011 02:21:35 +0000 GMT

Geert, I was following the roadmap instructions. They were not working until I loaded a non-blank setup after which they work fine. I ended up loading my original setup, then ran those commands through the eigencommander and saved that configuration as a new setup.

I'd just like to be able to do this starting from a blank setup so nothing other than the osc support ever gets loaded.

@NothanUmber I did load a non-blank setup first and then opened the blank one. The green bulb is lit (Belcanto Interpreter connected) but executing the statements does not work for me.


written by: dhjdhj

Tue, 22 Nov 2011 03:22:41 +0000 GMT

@barnone I implemented my basic Max patcher a little differently and avoided that problem with empty string. I'm still using a single regexp to detect that empty string but may replace it with a simple max external if efficiency becomes an issue.

Here are some top-down pictures of what I did.

EigenStrings The Eigen.Alpha.In object produces MIDI NoteOn/NoteOff messages (same as midiin) and pitchbend which can be fed into either a VST or an external MIDI instrument. The GenericVST is part of my Live Keyboard Rig Manager (see my blog here for more info on that library)


Eigen.Alpha.In This accepts nicely cleaned up KeyDown/KeyUp events, converts them to Row/Col number format (not sure I'm going to keep that, but it has some uses) and then the row/col info is converted into MIDI note numbers for a guitar-tuning layout.

Eigen.OSCInput Here I extract the raw OSC packets and I'm using a regex to feed me either a valid key number or 0 if the empty string is found.

The data is sent into the Eigen.OSCProcessor

Eigen.OSCProcessor Here, I'm basically keeping track of what keys are currently down by using the coll object using the event stream number as the index and the key number as the value. This patcher ensures that only a single keydown event is generated no matter how long a key is held.

So far, it has been totally glitchless so I'm optimistic about the approach.
My next step will be to properly integrate the continuous data for individual notes. It will be pretty trivial to generate polyphonic aftertouch events by finding the associated note number for the current stream and packing that with the pressure value. I'm not sure yet how I'm going to package the left-right data.



Please log in to join the discussions