Forum rss-feed

Forum

Software: How can I add simple MIDI out with WorkBench

Most Recent

written by: dhjdhj

Well, that "hack" has worked wonderfully for me, so I'm really glad it was there.

But having the velocity piece inside it rather than having to try and infer it from the existing OSC data or my new hack of taking initial MIDI notes as well would be great.

What other features were you thinking of including in the OSC agent? I'm just curious, it works very well as it is now.

written by: dhjdhj

Sat, 30 Jun 2012 04:08:32 +0100 BST

I have an extremely simple setup for my Alpha which basically just passes all events (keys, breath, strips) out as OSC.

Now, I've never figured out how to calculate an initial velocity when I first touch a key so I figured I would just leverage the fact that EigenD is already able to do this via MIDI OUT.

So what I'd like to do is modify my simple setup so that MIDI note on events get sent out when I first touch a key. The MIDI note numbers should just go from 1 to 120 (or 0 to 119, I don't care) and so I will just extra the velocity value out in the receiving system.

However, I haven't been able to get this to work. I tried adding what looked like the appropriate agents (and I set the MIDI output port in MIDI Output 1) but I'm not seeing any data.

Would appreciate any help.

(see picture at http://i.imgur.com/0dyPs.jpg)

Thanks,
D


written by: geert

Tue, 3 Jul 2012 07:56:18 +0100 BST

@dhjdhj, you need a scaler in the middle to generate frequency information based on the keys you press, the scaler's frequency output can then be connected to the midi converter to generate midi notes.

HTH,

Geert


written by: dhjdhj

Tue, 3 Jul 2012 14:14:55 +0100 BST

What's the definition of "middle"? Can you tell me the end to end chain of agents I need to connect together?

I did the following (see image) but I'm still not seeing any MIDI output. I did set the appropriate MIDI output device in the MIDI Output agent.

Maybe the other agents have to be configured (would be nice if they started with reasonable defaults in that case) and if so, I'd appreciate an example.

Thanks

http://i.imgur.com/aO11B.jpg


written by: geert

Tue, 3 Jul 2012 14:58:58 +0100 BST

The scaler needs the controller input and the MIDI converter needs the pressure input, see this screenshot. With this is works just fine:

http://c368672.r72.cf0.rackcdn.com/wiki_451_simplest_midi_output.png

Btw, if you just connect the top levels from the agents together, you don't have to think about it, it just works.


written by: dhjdhj

Tue, 3 Jul 2012 16:02:24 +0100 BST

OK --- making progress --- it IS working, but the only reason I didn't notice is because it's only working on one column on the Alpha, and it's not the column I was casually brushing my hand over!


What I need however is for each key to have a unique value, i.e, go from 1 to 120, without any scaling/interpretation so that I can just associate it with the data coming in via OSC and pass in the right velocity value.

So close..........really appreciating the help.


written by: dhjdhj

Tue, 3 Jul 2012 16:04:11 +0100 BST

Did that --- still not seeing any MIDI output.... see image. I have verified that I'm still seeing OSC data so I know Eigenharp/Max are communicating.

http://i.imgur.com/uGWSx.jpg


written by: geert

Tue, 3 Jul 2012 16:45:46 +0100 BST

You need to configure the scaler. By default it starts at octave 3 with a major scale, set it to octave -1 with a chromatic scale [0,1,2,3,4,5,6,7,8,9,10,11,12] to get all MIDI notes from C-2 to B7 on the 120 Alpha playing keys.


written by: dhjdhj

Tue, 3 Jul 2012 18:29:21 +0100 BST

OK --- I have this working now, but I did run into a bug along the way.



All keys worked fine with note on/note off events, except for the very first key which is only generating note on events, nothing gets generated when I release the key. That first key is producing MIDI Note Number 0. I see different velocities when I touch a key but nothing when I release it.

I then changed the base note from 0 to 1 in WorkBench. Now the events go from 1 to 120 (which actually suits me better) and I do see note off events for the first key.

Geert, thanks so much for the help. I would really love it if someone could help me create an algorithm that would let me calculate velocity by looking at only incoming OSC data, but this MIDI hack will provide a reasonable workaround in the short term.


written by: geert

Tue, 3 Jul 2012 20:01:26 +0100 BST

Thanks dhj, I committed a fix for that issue.


written by: geert

Thu, 5 Jul 2012 09:36:01 +0100 BST

Hi dhj,

You can find the velocity detection algorithm that we developed in GitHub here: https://github.com/Eigenlabs/EigenD/blob/2.0/piw/src/piw_velocitydetect.cpp

This took quite a while to get right, but everything is in there. It could be useful for you as a guide to create a velocity detector in Max for your patch.

HTH,

Geert


written by: dhjdhj

Thu, 5 Jul 2012 11:28:06 +0100 BST

Thanks, Geert. I'll take a look at that. However, I am wondering whether it might make sense for that code to be integrated into the OSC agent (perhaps as a configurable option of that agent). That way, if the option was turned on, then the first OSC packet to be produced would have the appropriate Z value in it representing an initial velocity.


written by: john

Thu, 5 Jul 2012 11:45:55 +0100 BST

Hi David

The OSC Agent is due an overhaul at some point soonish, perhaps for 2.1. The current version was a quick hack to act as a showcase for developers wanting to write their own agents and it needs a bit more thought as yet. I'll add the velocity estimation in to the desired feature list for the new version.

John


written by: dhjdhj

Thu, 5 Jul 2012 13:10:46 +0100 BST

Well, that "hack" has worked wonderfully for me, so I'm really glad it was there.

But having the velocity piece inside it rather than having to try and infer it from the existing OSC data or my new hack of taking initial MIDI notes as well would be great.

What other features were you thinking of including in the OSC agent? I'm just curious, it works very well as it is now.



Please log in to join the discussions