Old 09-17-2018, 04:49 PM   #1
WayfarerAM
Human being with feelings
 
Join Date: Sep 2018
Posts: 2
Default MIDI to OSC Translator Help

I'm trying to use OSCII-bot to send OSC commands from MIDI notes. The problem is I'm not the best coder and I'm not sure where I'm getting stuck. Here is what I've written based off the examples:

Code:
@input midi_in MIDI "E-MU XMidi1X1 Tab"
//"Name" is full device name from device manager

@output osc_out OSC "localhost:8000"
//Loop back to computer, match in port of Nomad


@midimsg
	msg1 == 90 ? (
		msg2 == 01; 
			oscsend(osc_out,"/eos/chan=1");
		msg2 == 02; 
			oscsend(osc_out,"/eos/chan=2");
		msg2 == 03; 
			oscsend(osc_out,"/eos/chan=3");
		msg2 == 04; 
			oscsend(osc_out,"/eos/chan=4");
		msg2 == 05; 
			oscsend(osc_out,"/eos/chan=5");
		msg2 == 06; 
			oscsend(osc_out,"/eos/chan=6");
		msg2 == 07; 
			oscsend(osc_out,"/eos/chan=7");	
	);
I can see the MIDI notes coming in along the bottom of the OSII window but OSC doesn't come out. I'm still in the testing phase so the actual OSC mesage will change once I can get this working.

EDIT:
Skipped the explanation of what I need. I need to send a different OSC message based on the note received.

Last edited by WayfarerAM; 09-18-2018 at 12:05 AM.
WayfarerAM is offline   Reply With Quote
Old 09-17-2018, 09:44 PM   #2
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,634
Default

the instruction
x == 7;
is a NOP.

Guessing what you are trying to accomplish:

EEL code for "case":

Code:
  a == 1 ? (
     b = 10;   
   ) : a == 2 ? (
     b = 20;   
   ) : a == 3 ? (
     b = 30;   
   ) : a == 4 ? (
     b = 40;   
   ) : a == 5 ? (
     b = 50;   
  );
-Michael
mschnell is offline   Reply With Quote
Old 09-18-2018, 12:03 AM   #3
WayfarerAM
Human being with feelings
 
Join Date: Sep 2018
Posts: 2
Default

I'm assuming from the programming document that the parts of a MIDI message of the structure. In OSCII msg1 is the channel, msg 2 is the note, and msg 3 is velocity. The controller I'm using sends all the information on the same channel so msg1 should remain the same but msg2 would be different depending on the button (MIDI note). I want different OSC messages depending on the note.
WayfarerAM is offline   Reply With Quote
Old 09-18-2018, 06:46 AM   #4
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,634
Default

Quote:
Originally Posted by WayfarerAM View Post
I'm assuming from the programming document that the parts of a MIDI message of the structure. In OSCII msg1 is the channel, msg 2 is the note, and msg 3 is velocity.
Correct, it the Midi message is a Note-on or Note-Off event. In your code you seem to try to test for msg1 being 90 hexadecimal, which means note on, channel 1.
In EEL (and C and many other languages), hexadecimal is denoted by 0x90. While "90" just means 90, "0x90" means a decimal value of 144.


Quote:
Originally Posted by WayfarerAM View Post
The controller I'm using sends all the information on the same channel so msg1 should remain the same but msg2 would be different depending on the button (MIDI note). I want different OSC messages depending on the note.
Seems like correct, but not related to the bugs in the code you posted. You first need to learn the EEL syntax.

-Michael

Last edited by mschnell; 09-18-2018 at 09:25 PM.
mschnell is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:32 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.