lagauche Posted November 10, 2017 Share Posted November 10, 2017 Hey all, Has anyone integrated web midi with BabylonJS? I'd like to trigger events in Babylonjs with WebMIDI. I'd also like to explore OSC but WebMIDI is more important. Unfortunately a google search turned up next to nothing. If anyone can point me to some libraries or pass me any tips i'd much appreciate it! Quote Link to comment Share on other sites More sharing options...
RaananW Posted November 10, 2017 Share Posted November 10, 2017 I had an interesting discussion about WebMIDI and the actual need of it. I know it is off-topic, but... Why do you need it? And no, I am sorry, I haven't seen a project using both, but it is living in the same eco-system, I don't see a reason why it wouldn't work just like using any other events. lagauche 1 Quote Link to comment Share on other sites More sharing options...
lagauche Posted November 10, 2017 Author Share Posted November 10, 2017 1 hour ago, RaananW said: I had an interesting discussion about WebMIDI and the actual need of it. I know it is off-topic, but... Why do you need it? And no, I am sorry, I haven't seen a project using both, but it is living in the same eco-system, I don't see a reason why it wouldn't work just like using any other events. I make electronic music. Lately I've been live coding. Long story short: I would like to make performance pieces that allow me to create music and interact with visuals at the same. The wonderful thing about midi is of course that I can use its data for both at the same time. I have web midi working in another webgl engine, but I'm hoping to switch to Babylonjs. I'm just getting started with Babylonjs and I don't know what to expect : ) I'm not a game developer at all. P.S. You are definitely not off-topic. Any conversion about these things is good conversation : ) Quote Link to comment Share on other sites More sharing options...
RaananW Posted November 10, 2017 Share Posted November 10, 2017 I know MIDI very well, I have been using it quite a lot (producing music). And I know how helpful it can be, BUT - The MIDI standard defines inputs as octets (0 to 255). It is quite limited! AFAIK, WebMIDI didn't change that. they are still using octets to define inputs. I just think there are better and more precise ways of receiving input from an external device. Just think about pressure points from your keyboard (0 to 127). A stylus of the Samsung note 5 has more pressure points than a midi keyboard... And that's a few years old And besides, the only browser that supports WebMIDI is chrome, isn't it? They actually invested the time implementing this proposal... IMO, this makes Chrome the new IE6, but that's another long discussion BUT! I really want to see what you do with midi and babylon, and will be more than happy to answer any qustions along the way. Quote Link to comment Share on other sites More sharing options...
lagauche Posted November 10, 2017 Author Share Posted November 10, 2017 Thank you! I'm going to take you up on your help offer. Please get ready for some very basic questions heading your way in the future : ) Open sound control is much more ideal considering your concerns yes, but it's tougher to setup, not to mention it's not native in any browser. If I can find a way to work with OSC instead (even if i'm restricted to a local web server), I will! Despite people trying to retire midi for a long time, it's just omnipresent as far as support goes and of course every music application can send it, which opens up a lot of possibilities for me to incorporate any music applications. Also, it's very easy for any non-technical person to plug in a usb midi controller, open Chrome and have everything working. I'm not interested in developing for the general public right now, but you never know. I loath the idea of sweeping a filter with 0-127 steps. I would just never do it : ) But maybe for visuals, I can make it work. Fingers crossed. webGLmmk 1 Quote Link to comment Share on other sites More sharing options...
Pryme8 Posted November 10, 2017 Share Posted November 10, 2017 I can prolly supply the script I was working on for this which like a simple version of what you are talking about. lagauche 1 Quote Link to comment Share on other sites More sharing options...
lagauche Posted November 10, 2017 Author Share Posted November 10, 2017 5 hours ago, Pryme8 said: I can prolly supply the script I was working on for this which like a simple version of what you are talking about. I would definitely give it a go! Quote Link to comment Share on other sites More sharing options...
lagauche Posted November 10, 2017 Author Share Posted November 10, 2017 @RaananW Do you know why I'm getting NaN? fade1 is the variable with a CC value between 0-127. I am very new to Babylonjs, Javascript and WebGL. Please bear with me. I learn quickly : ) I thought the screenshot code might work since object1.rotation.y += 0.02; rotates my mesh. scene = createScene( ); engine.runRenderLoop( function( ) { object1.rotation.y = fade1 * 0.02; scene.render( ); } ); Quote Link to comment Share on other sites More sharing options...
lagauche Posted November 11, 2017 Author Share Posted November 11, 2017 scene.registerBeforeRender( function( ) { object1.rotation.x = cc1 * 0.05; I switched over to this for rotating the object and it worked : ) Quote Link to comment Share on other sites More sharing options...
RaananW Posted November 13, 2017 Share Posted November 13, 2017 Hey That's quite interesting. Switching between the x and the y should not make any different. I assume there was an error reading the variable? or maybe it was a string that was returned and not a number , which couldn't be multiplied with 0.02 Quote Link to comment Share on other sites More sharing options...
laureano Posted March 22, 2021 Share Posted March 22, 2021 Hello!! I have arrived a little late to this discussion. I produce graphics for shows and so on.. Did you have any chance devoping these midi / babylon connections? I would really apreciate some help. cheers Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.