OS X MT32Emu and DOSBox *and* USB2Midi

Developer's Forum for discussion of bugs, code, and other developmental aspects of the Munt Project.

OS X MT32Emu and DOSBox *and* USB2Midi

Postby Dominus » 2013-10-18 @ 08:03

Referencing the problem at viewtopic.php?f=40&t=36699&start=40#p325587 that the Munt driver is only being used when the real hardware is not plugged in.

I wonder whether one can adapt https://ccrma.stanford.edu/~craig/artic ... testout2.c to DOSBox' Coremidi driver.
The relevant part is that this code seems to send to *all* ports
Code: Select all
//////////////////////////////
//
// playPacketOnAllDevices -- play the list of MIDI packets
//    on all MIDI output devices which the computer knows about.
//    (Send the MIDI message(s) to all MIDI out ports).
//

void playPacketListOnAllDevices(MIDIPortRef midiout,
      const MIDIPacketList* pktlist) {
   // send MIDI message to all MIDI output devices connected to computer:
   ItemCount nDests = MIDIGetNumberOfDestinations();
   ItemCount iDest;
   OSStatus status;
   MIDIEndpointRef dest;
   for(iDest=0; iDest<nDests; iDest++) {
      dest = MIDIGetDestination(iDest);
      if (status = MIDISend(midiout, dest, pktlist)) {
          printf("Problem sendint MIDI data on port %d\n", iDest);
          printf("%s\n", GetMacOSStatusErrorString(status));
          exit(status);
      }
   }
}


While DOSBox sends to a specific one (I think)...
https://sourceforge.net/p/dosbox/code-0 ... coremidi.h

But I'm not very good at programming and easily get confused :)
User avatar
Dominus
DOSBox Moderator
 
Posts: 7285
Joined: 2002-10-03 @ 09:54
Location: Vienna

Re: OS X MT32Emu and DOSBox *and* USB2Midi

Postby Qbix » 2013-10-18 @ 08:16

coremidi in dosbox wants a number, not a name.

see
Code: Select all
if(conf && conf[0]) destId = atoi(conf);


(atoi is Ascii TO Integer)
Water flows down the stream
How to ask questions the smart way!
User avatar
Qbix
DOSBox Author
 
Posts: 10375
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: OS X MT32Emu and DOSBox *and* USB2Midi

Postby sergm » 2013-10-18 @ 08:17

Hmm, true ;)
sergm
Oldbie
 
Posts: 734
Joined: 2011-2-23 @ 16:37

Re: OS X MT32Emu and DOSBox *and* USB2Midi

Postby Dominus » 2013-10-18 @ 08:18

I'll play with that... ;)
User avatar
Dominus
DOSBox Moderator
 
Posts: 7285
Joined: 2002-10-03 @ 09:54
Location: Vienna

Re: OS X MT32Emu and DOSBox *and* USB2Midi

Postby sergm » 2013-10-18 @ 08:21

Btw, is the listmidi option supported under OS X?
EDIT:
viewtopic.php?f=40&t=36699&p=325664#p325664
sergm
Oldbie
 
Posts: 734
Joined: 2011-2-23 @ 16:37


Return to MT-32 Development

Who is online

Users browsing this forum: No registered users and 1 guest