Real noob MIDI and JUCE Question

Hi

You will have to bear with me on this as I have almost no C++ experience and I have just started to use JUCE…my apologies for what will probably be a simple question/answer :wink:

Could somebody post/knock up a bit of code to show me how to find my MIDI interface.
I would also like to be able to have a slider talk to my keyboard in SysEx (I know how to do all the Hex stuff, manufacturers i.d etc) but have no idea how to implement this. I already have a slider available on a window component and a combo box (for the MIDI interface choice).

Again, sorry if this is really dumb, I’m just trying to get my head round all this code at the moment and have not succeeded in getting any kind of MIDI interface capture.:oops:

Thanks

P.S. Working on Windows XP

Hi! Do you mean: you want to get a MIDI Input Device handle, or that you want to open a MIDI device so you can send it some events? :slight_smile: Pete

Hi peteatjuce,

Thanks for the reply.

I would like to get Juce to talk to my Synth via my EMU1820m sound card (has MIDI interface built in). So I guess I need to open a MIDI interface.
I’d also like to be able to set up a slider to send System Exclusive to my Synth (I know I have to set up each slider etc for each parameter in the synth).
Just to get even an idea of how to go about it would help because, at the moment, I’m blindly trying to go through the documentation and try and code it, but it all just seems to fail and throw up errors on compile.
(I can compile the 2 demo’s with JUCE ok, so no problems with my setup of C++ express).
I have also thought that perhaps a combobox is not the right component to use for the MIDI interface selection, would a Listbox be better ?

Anyhow, any info greatly received, thanks…

:slight_smile:

Look at the source for the audio page in the demo. I think it demonstrates how to do what you want.
I haven’t looked at this my self, but I think there is a pre-made pop-up component that lets you select a midi interface.

Hey, thanks Rock Hardbuns.

This shows how new I am to this. I never thought to look into the other types of Demo.

I should be able to proceed a little now, thanks again…

Edited out my stupidity.

Should have looked more throughly. Found what I needed, right in front of my eyes. :oops:

The audio settings window is a part of JUCE it self:
http://www.rawmaterialsoftware.com/juce/api/classAudioDeviceSelectorComponent.html

Yeah, sorry Rock Hardbuns. I was just editing my posting as you posted to point out my stupidity.

Thanks…

I didn’t mean to make you feel stupid. I am but a humble noob myself. I just felt that a brief answer would suffice. :smiley:

BTW, the audio settings window referred to above doesn’t show MIDI output devices. :slight_smile: In shows audio in/out and MIDI in, but not MIDI out. There is a separate thread open somewhere where I asked Jules to update that code sometime. It is easy enough to do if you’ve got a few C++ chops.

Anyways, it is pretty easy to list the MIDI output devices in your own combo box, using something like this:

void MyPopulate (ComboBox *PpComboBox)
{
  PpComboBox->clear();

  StringArray lDevices = MidiOutput::getDevices();
  int lDeviceCount = lDevices.size();
  if (lDeviceCount == 0)
  {
    // ("No devices found\n");
    return;
  } 

  int i;
  for (i = 0; i < lDevices.size(); i++)
  {
    PpComboBox->addItem(lDevices[i], i+1);
  }
}

Hopefully you get the general idea.

HTH!

Pete

Found the other thread…

http://www.rawmaterialsoftware.com/juceforum/viewtopic.php?t=1877

HTH!

Pete