Sign in to follow this  
Followers 0
ruipenha

Newbie - interfacing with MaxMSP

10 posts in this topic

Hi!

I’m finishing my first MidiBox 64, which was built in a modular way (hardware) in order to be able to change the interface (acrylic rectangle with buttons, pots, leds, etc.) and keep the same pcbs, ports and wooden box.

As I’ll use it to control my own programs in MaxMSP, I would like to have the following configuration always active:

2 x Ain – from CC1 to CC64 (or from CC64 to CC127 if that’s difficult to implement), all on midi channel 1

2 x Dout – from midi note 1 to midi note 64, all on midi channel 1

2 x Din – I don’t really understand how can I light the leds, if possible I would like to have it configured as note-ons and note-offs, from midi note 1 to midi note 64, all on midi channel 1 (or 2 if this can cause problems with the above Dout configuration)

Also I would like to disable the core function that sends midi notes it receives in the Midi-Out plug (midi-merge?).

Sorry if this is really an easy subject, but I uploaded the MIOS .hex and Main.hex from the MidiBox64 folder, using a difficult PC (I’m a Mac user ;) and I can’t seem to find the information I need to get this done.

Also, I’m sorry if my English is not as good as it should be, but it’s not my native language.

Best regards,

Rui Penha

Share this post


Link to post
Share on other sites

2 x Dout – from midi note 1 to midi note 64, all on midi channel 1

2 x Din – I don’t really understand how can I light the leds, if possible I would like to have it configured as note-ons and note-offs, from midi note 1 to midi note 64, all on midi channel 1 (or 2 if this can cause problems with the above Dout configuration)

I think you may have it backwards. DOUT is used for digital output from the core, ie; to light LEDs. DIN is used to accept digital input into the core, ie. to read button presses from your interface.

There's a clear example in C of how to light LEDs based on MIDI note here: http://www.ucapps.de/mios_c_set_dout.html.

Start there and keep on reading. That's the best way to learn how MIDIBox works.

-drin

Share this post


Link to post
Share on other sites

Hi!

Thanks for your quick reply.

Yes, I know my douts and my dins! It was only a mistake when posting the question... The link you gave me was good, although my knowledge in C is zero, nada... I guess it's time to start working on that!

I'll look at the programming side and post new questions as they arise.

When I finnish my Midibox, I'll also post some photos of it, as I documented all the process. It's actually an instrument to play live, controlling 5 computers at once. I have no problem on the computer side, the electronics part it's a bit difficult, as I was a total virgin on this subject before starting this project. My midibox will control audio synthesis, video synthesis, sampling, granular synthesis, all done with MaxMSP & Jitter, that's why I would like to have simple commands from the Midibox and then translate them via computer software to do what I need, as it is very simple to implement midi control in Max.

Best regards,

Rui

Share this post


Link to post
Share on other sites

Hi Rui!

Since you are already using max you should be able to use the stock mb64 app without modification.......I would either:

A) do a quick remap of the incoming midi via max near the inlet to pass the data the way the rest of your patch is expecting it,

or

B) take a look at what the stock mb 64 app is sending already and tell your max patch to listen for those messages instead.

My favorite answer is B.  :)

Not trying to talk you out of learning how to code for MIOS, etc... just trying to reduce the learning curve needed to meet your goal.  ;D

Love my macs and my max here too.... ;)

Best

Smash

Share this post


Link to post
Share on other sites

Hi Smash! Funny, I've just ordered a core kit from you... I guess soldering is like programming: first you hate it, then you crave it...

Yes, I tried the B solution... but I found that there were two things I didn't want happening:

- the midi in was getting out (midi-merge, I guess)

- I couldn't light up the leds  ???

- some buttons and leds wer assigned to midibox functions, and I don't have any LCD (lazy me...)

I guess I'll step in to MIOS programming, the documentation in the codes given is so good I don't think it should be a problem. Still, if anyone has some ideas that might help me, you're welcome!!  ;D

Thank you all, I'm really starting to feel I've joined a good community!

Rui

Share this post


Link to post
Share on other sites

I guess soldering is like programming: first you hate it, then you crave it...

Thank you all, I'm really starting to feel I've joined a good community!

Hah! I laughed so loud when I read that hehehehehe :) Yeh, it's a love-hate relationship for sure!

Glad you're feeling welcome man :) Don't stress about programming MIOS, TK has made it very easy, considering how complex it really is behind all his awesome code. You'll be midiboxing away in no time :) I was thinking though, you might have an easier time of things if you are able to connect an LCD. You should be able to get one for like $5 (just 2x16, no backlighting or fancy stuff that you don't need for testing), it's so worth it.

Good luck!

Share this post


Link to post
Share on other sites

Another Max user, good choice son!

Using Max and Midibox couldn't be simpler. You'll probably want to use the USB interface because Max automatically reads every single input device that's connected via USB. I'm not on a machine with Max at the moment so I'm not exactly sure of the process you'd go through (I'm still a learning Max at the moment), but I intend to use my Midibox with Max so drop us an email if you like and we can share some knowledge. ;)

Pz. Jackson

Share this post


Link to post
Share on other sites

Good on ya for choosing the more difficult but way more rewarding route!  ;)

Please post about any issues you come across due to coding on the Mac vs. the "normal" dev environment.....we'll enlist some non-MIDIbox Mac coders if ya hit a stop.  ;)

BTW: Your order (and others) should go out on the next run.....hopefully Monday night.....doing my best to get back to quick shipping times... :)

Best

Smash

Share this post


Link to post
Share on other sites

Hi again!

All done... I have my Midibox configured to:

- send note-on and note-off on button activities, from note 0 to note 63 on channel 1;

- receive note-on and note-off, again from 0 to 63, on channel 1 and activate leds (please see the remark below!);

- send CC from 0 to 63 on channel 1 with pot activities (US users: is it safe to write the expression "pot activities" in a forum? ;D)

I find this is the best way to have an all-purpose connection to MaxMSP, using the computer to route whatever I want done.

In the examples on the C programming page, I found this example regarding Dout and Leds:

/////////////////////////////////////////////////////////////////////////////

//  This function is called by MIOS when a complete MIDI event has been received

/////////////////////////////////////////////////////////////////////////////

void MPROC_NotifyReceivedEvnt(

  unsigned char evnt0, unsigned char evnt1, unsigned char evnt2) __wparam

{

  // a note event provides 128 different note values (0..127)

  // in this simple example, each note sets an individual pin

  // for DOUT pin numbers, see also this documentation:

  // http://www.ucapps.de/mios/mios_pin_list.txt

  if( evnt0 == 0x80 || evnt0 == 0x90 ) {

    // 90 xx 00 is the same like a note off event!

    // (-> http://www.borg.com/~jglatt/tech/midispec.htm)

    if( evnt0 == 0x80 || evnt2 == 0x00 ) {

      // Note Off

      MIOS_DOUT_PinSet(pin, 0);

    } else {

      // Note On

      MIOS_DOUT_PinSet(pin, 1);

    }

  }

}

but I had to change it to (in the last lines):

    if( evnt0 == 0x80 || evnt2 == 0x00 ) {

      // Note Off

      MIOS_DOUT_PinSet(evnt1, 0);

    } else {

      // Note On

      MIOS_DOUT_PinSet(evnt1, 1);

    }

  }

}

for it to work, as the compiler complained (funny expression! "compiler complained" :) again, please note that I'm portuguese, not native-english speaker!) that the variable pin was not declared.

I don't know if it's merely my mistake, as I've never programmed in C or done any midibox activity before, but now it is working correctly.

Best regards and thanks for everything!

Rui

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0