public inbox for linux-msdos@vger.kernel.org
 help / color / mirror / Atom feed
* MIDI input
@ 2008-06-12 22:12 x.zupftom
  2008-06-12 22:57 ` Tony Borras
  0 siblings, 1 reply; 17+ messages in thread
From: x.zupftom @ 2008-06-12 22:12 UTC (permalink / raw)
  To: linux-msdos

Hi again,

I'm facing the task of feeding MIDI events into Dosemu.  By making a symbolic link from dosemu-midi to /dev/midi# I can send my MIDI data to my MIDI keyboard, but what about the other direction?  The archives say I have to "create a ~/.dosemu/dosemu-midi_in pipe and forward [my] midi data to it".  I'm pretty new to Linux, so I would be glad if someone could explain to me in more detail how to do it.  I tried to create a symbolic link from dosemu-midi_in to /dev/midi1 (this device works fine for output), but I suspect that this makes sense (how would /dev/midi1 know it has to send the MIDI data to dosemu-midi_in?).  The DOS application does not appear to receive any MIDI data this way if I play on the keyboard.  However, it could also be the the DOS program is not set up properly.  Is there a way I can test whether Dosemu receives MIDI data?

Thomas W.
______________________________________________________________
Jeden Monat 1 hochkarätiger maxdome-Blockbuster GRATIS!
Exklusiv für alle WEB.DE Nutzer. http://www.blockbuster.web.de

--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: MIDI input
  2008-06-12 22:12 x.zupftom
@ 2008-06-12 22:57 ` Tony Borras
  0 siblings, 0 replies; 17+ messages in thread
From: Tony Borras @ 2008-06-12 22:57 UTC (permalink / raw)
  To: linux-msdos

On Fri, 13 Jun 2008 00:12:01 +0200
x.zupftom@web.de wrote:

>I have to "create a ~/.dosemu/dosemu-midi_in pipe and forward
>[my] midi data to it".  I'm pretty new to Linux, so I would be
>glad if someone could explain to me in more detail how to do
>it.

This seems to explain in more detail:

http://seduction.dk/usr/doc/dosemu-0.99.13/sound-usage.txt




^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: MIDI input
@ 2008-06-12 23:47 x.zupftom
  2008-06-13  0:50 ` Dave Phillips
  0 siblings, 1 reply; 17+ messages in thread
From: x.zupftom @ 2008-06-12 23:47 UTC (permalink / raw)
  To: linux-msdos, Tony Borras

> -----Ursprüngliche Nachricht-----
> Von: "Tony Borras" <tonyb@sysdev.org>

> On Fri, 13 Jun 2008 00:12:01 +0200
> x.zupftom@web.de wrote:
> 
> >I have to "create a ~/.dosemu/dosemu-midi_in pipe and forward
> >[my] midi data to it".  I'm pretty new to Linux, so I would be
> >glad if someone could explain to me in more detail how to do
> >it.
> 
> This seems to explain in more detail:
> 
> http://seduction.dk/usr/doc/dosemu-0.99.13/sound-usage.txt
> 

Thanks for your quick response.  I'm aware of those instructions, but unfortunately dosemu-midi_in isn't mentioned anywhere.  Possibly I'm again missing (or misunderstanding) something??

I already tried
    cat /dev/midi1 > test.txt
and it writes some garbage to test.txt - so MIDI input via midi1 is working.  My problem is now how to connect /dev/midi1 to dosemu-midi_in.  If it's already connected by
    ln -s /dev/mid1 ~/.dosemu/run/dosemu-midi_in
then how can I test whether Dosemu receives the data?

Thomas W.
_______________________________________________________________________
Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 30 Tage
kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc=022220

--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: MIDI input
  2008-06-12 23:47 x.zupftom
@ 2008-06-13  0:50 ` Dave Phillips
  0 siblings, 0 replies; 17+ messages in thread
From: Dave Phillips @ 2008-06-13  0:50 UTC (permalink / raw)
  To: x.zupftom; +Cc: linux-msdos, Tony Borras

x.zupftom@web.de wrote:
> [snip]
>
> I already tried
>     cat /dev/midi1 > test.txt
> and it writes some garbage to test.txt - so MIDI input via midi1 is working.  My problem is now how to connect /dev/midi1 to dosemu-midi_in.  If it's already connected by
>     ln -s /dev/mid1 ~/.dosemu/run/dosemu-midi_in
> then how can I test whether Dosemu receives the data?

I've been running Voyetra's Sequencer Plus Gold under DOSemu for many 
years. I load the ALSA virtual MIDI module (modprobe snd-virmidi) then I 
link the DOSemu MIDI I/O like so:

ln -s /dev/snd/midiC2D0 ~/.dosemu/run/dosemu-midi

ln -s /dev/snd/midiC1D0 ~/.dosemu/run/dosemu-midi_in

where midiC2D0 is the ALSA virmidi module and midiC1D0 is the external 
MIDI port on my PCI soundcard.

Just to be sure, I tested MIDI input with these connections before I 
posted this message. It worked fine. :)

Best,

dp


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: MIDI input
@ 2008-06-13 18:09 x.zupftom
  0 siblings, 0 replies; 17+ messages in thread
From: x.zupftom @ 2008-06-13 18:09 UTC (permalink / raw)
  To: Dave Phillips; +Cc: linux-msdos

> -----Ursprüngliche Nachricht-----
> Von: "Dave Phillips" <dlphillips@woh.rr.com>
> Gesendet: 13.06.08 03:05:46
> An: x.zupftom@web.de
> CC: linux-msdos@vger.kernel.org, Tony Borras <tonyb@sysdev.org>
> Betreff: Re: MIDI input
> 
> I load the ALSA virtual MIDI module (modprobe snd-virmidi) then I 
> link the DOSemu MIDI I/O like so:
> 
> ln -s /dev/snd/midiC2D0 ~/.dosemu/run/dosemu-midi
> 
> ln -s /dev/snd/midiC1D0 ~/.dosemu/run/dosemu-midi_in
> 
> where midiC2D0 is the ALSA virmidi module and midiC1D0 is the external 
> MIDI port on my PCI soundcard.
> 

Thank you!  That's exactly the kind of information I was looking for.  I'll try it when I have the time and report whether or not I can get it to work.

As I already wrote, I don't know whether the DOS app is set up correctly to receive MIDI data - I never had the chance to use it with MIDI input.  I'm still interested in whether there is a way to test whether Dosemu is receiving the MIDI data without this particular DOS program.

Thanks again!

Thomas W.
_______________________________________________________________________
Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 30 Tage
kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc=022220

--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: MIDI input
@ 2008-06-13 21:54 x.zupftom
  0 siblings, 0 replies; 17+ messages in thread
From: x.zupftom @ 2008-06-13 21:54 UTC (permalink / raw)
  To: Dave Phillips; +Cc: linux-msdos

Some more questions:

> -----Ursprüngliche Nachricht-----
> Von: "Dave Phillips" <dlphillips@woh.rr.com>
>
> I load the ALSA virtual MIDI module (modprobe snd-virmidi)

Is that necessary?  What is this virtual MIDI card needed for?  I can "record" notes from /dev/midi1, /dev/dmmidi1 and /dev/snd/midiC1D0 like
    cat /dev/midi1 > record
and send the data back to my MIDI keyboard using the same three devices like
    cat record > /dev/midi1
I can hear the notes I recorded before (as expected the timing gets lost).  After doing
    sudo modprobe snd-virmidi
four additional devices (/dev/snd/midiC2D0 to /dev/snd/midiC2D3) are created, but I can neither record nor play back notes in the manner I described above.  Do I still have to do something with those devices?

My suspicion is that everything should also work without snd-virmidi, but I find it strange that all three original devices can be used both for recording and playback.  In fact, I can link dosemu-midi to all of them, and MIDI out works with all of them.  I also tried to link dosemu-midi_in to any of them, but up to now I had no success.  I don't know whether it's because of Dosemu or the DOS program that it does not work.  Do I have to change anything in the dosemu.conf to make it work?

I guess with the appropriate debugging flags it should be possible to tell from the content of ~/.dosemu/boot.log whether MIDI input was received.  What flags should I use?

TIA
Thomas W.
____________________________________________________________________
Ihre Messenger, Communities und E-Mails jetzt in einem Programm!
WEB.DE MultiMessenger http://www.produkte.web.de/messenger/?did=3071

--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: MIDI input
@ 2008-06-15  9:42 x.zupftom
  2008-06-16 16:38 ` Dave Phillips
  0 siblings, 1 reply; 17+ messages in thread
From: x.zupftom @ 2008-06-15  9:42 UTC (permalink / raw)
  To: linux-msdos

> -----Ursprüngliche Nachricht-----
> Von: <x.zupftom@web.de>

> > -----Ursprüngliche Nachricht-----
> > Von: "Dave Phillips" <dlphillips@woh.rr.com>
> >
> > I load the ALSA virtual MIDI module (modprobe snd-virmidi)
> 
> Is that necessary?

I found it's not.  I got MIDI input to work - somehow.  Thanks again, Dave, that's already a huge success for me.  The problem now is that after pressing a key on the MIDI keyboard, it can take several seconds until the program reacts to it.  What can I do about that?

Thomas W.
____________________________________________________________________
Ihre Messenger, Communities und E-Mails jetzt in einem Programm!
WEB.DE MultiMessenger http://www.produkte.web.de/messenger/?did=3071

--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: MIDI input
  2008-06-15  9:42 MIDI input x.zupftom
@ 2008-06-16 16:38 ` Dave Phillips
  0 siblings, 0 replies; 17+ messages in thread
From: Dave Phillips @ 2008-06-16 16:38 UTC (permalink / raw)
  To: x.zupftom; +Cc: linux-msdos

x.zupftom@web.de wrote:
> ...  I got MIDI input to work - somehow.  Thanks again, Dave, that's already a huge success for me.  The problem now is that after pressing a key on the MIDI keyboard, it can take several seconds until the program reacts to it.  What can I do about that?
Hi Thomas,

Sorry for the delay, I'm swamped with work at the moment.

The problem is latency, probably system latency. What distribution are 
you using ?

What's the hog threshold set for in dosemurc ?

I use JAD 1.0 (OpenSUSE 10.2) for 32-bit work, 64 Studio for 64-bit 
work. I run DOSemu on both machines. Both systems are equipped with 
low-latency kernels, and I routinely run the JACK server with less than 
6 msecs latency and no xruns.

I prefer DOSemu on the 32-bit box, but performance is good on both 
machines. Btw, I only use DOSemu to run Sequencer Plus Gold, so the MIDI 
I/O has to work for me. :)

Best,

dp


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: MIDI input
@ 2008-06-16 21:22 x.zupftom
  2008-06-16 23:23 ` Dave Phillips
  0 siblings, 1 reply; 17+ messages in thread
From: x.zupftom @ 2008-06-16 21:22 UTC (permalink / raw)
  To: Dave Phillips; +Cc: linux-msdos

> -----Ursprüngliche Nachricht-----
> Von: "Dave Phillips" <dlphillips@woh.rr.com>

> x.zupftom@web.de wrote:
> > ...  I got MIDI input to work - somehow.  Thanks again, Dave, that's already a huge success for me.  The problem now is that after pressing a key on the MIDI keyboard, it can take several seconds until the program reacts to it.  What can I do about that?

> 
> The problem is latency, probably system latency. What distribution are 
> you using ?

I'm using Ubuntu 8.04 "Hardy" AMD64 on a dual core machine.

> 
> What's the hog threshold set for in dosemurc ?

Do you mean dosemu.conf?  Up to now the hogthreshold was commented out.  I tried to set it to 0, 1, 100, but it makes no difference.

Someone (who's not on this list) suggested it might be a polling issue.  With the S debugging switch I checked how often Dosbox reads the MIDI input buffer.  I found it depends on whether the buffer is filled or not.  If it's empty, Dosemu checks it about twice per second - if I play on my MIDI keyboard, it reads the buffer e.g. about 20 times per second.  That's more than enough for my purposes (precise timing is not a problem, I only need step time input).

The behaviour is really strange.  I tried playing a chromatic scale (staccato to make sure notes do not overlap) over two octaves at different speeds.  The results are mostly well reproducible:

- If I play at 120 bpm, the first eight notes appear, then nine notes are dropped, and the final eight notes appear again.  The notes (the program actually writes out the note names in text form) appear one after the other, one every 1.5 seconds or so.  I believe the time varies slightly, but I'm not sure.
- If I play at 92 bpm, the first nine notes appear.  The 1.5 second intervals are the same as with 120 bpm.
- At 126 bpm I have less consistent results.  Most of the time it shows the first eight notes correctly, then it either drops either 14 or 15 notes and displays the two or three last ones.  Sometimes the behaviour is even stranger.  The program simply shows garbage, even notes that I never played.  That looks more like a bug in the DOS program, but I never heard reports about such a bug under native MS DOS.  Maybe the program simply does not "like" the way MIDI input is implemented in Dosemu.

Sometimes the program hangs after inputting MIDI.  It does neither react to the keyboard nor to the mouse.  I just discovered that if I press some keys on the qwertz keyboard, they only appear if I press a key on the MIDI keyboard afterwards.  But the program does not accept any MIDI input any more.  The whole I/O seems to be messed up.

If the program hangs, pressing some keys on the MIDI keyboard may trigger that some notes are shown, but those notes do not correspond with the pressed key.  I first suspected they are notes that were still in the input buffer, but at least sometimes it seems to me that it's complete garbage that can't have been in the buffer.  Sometimes two notes appear upon one keystroke, sometimes only one.  Sometimes it hangs completely and does not even respond to the MIDI keyboard any more.

Maybe some background information can help finding a solution:  With DOS (or Windows), up to now, no user of this program has MIDI input working on a machine without ISA MIDI card.  Some of them even consider buying old used machines with ISA slots in order to work with MIDI input.  Output sometimes works fine, but input does not work at all without ISA.  What could be the cause for this?  What consequences might it have for running the program in Dosemu?  Dosemu could be an option for many users if MIDI input actually worked.

I still don't give up hope, though it looks almost impossible to get this working properly.

Thomas W.
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066

--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: MIDI input
  2008-06-16 21:22 x.zupftom
@ 2008-06-16 23:23 ` Dave Phillips
  0 siblings, 0 replies; 17+ messages in thread
From: Dave Phillips @ 2008-06-16 23:23 UTC (permalink / raw)
  To: x.zupftom; +Cc: linux-msdos

x.zupftom@web.de wrote:
> I'm using Ubuntu 8.04 "Hardy" AMD64 on a dual core machine.
>   
That's likely a plain-vanilla kernel. See if there's a low-latency 
kernel for that system, it might help.


> Someone (who's not on this list) suggested it might be a polling issue.  With the S debugging switch I checked how often Dosbox reads the MIDI input buffer.  I found it depends on whether the buffer is filled or not.  If it's empty, Dosemu checks it about twice per second - if I play on my MIDI keyboard, it reads the buffer e.g. about 20 times per second.  That's more than enough for my purposes (precise timing is not a problem, I only need step time input).
>
> The behaviour is really strange.  I tried playing a chromatic scale (staccato to make sure notes do not overlap) over two octaves at different speeds.  The results are mostly well reproducible:
>
> - If I play at 120 bpm, the first eight notes appear, then nine notes are dropped, and the final eight notes appear again.  The notes (the program actually writes out the note names in text form) appear one after the other, one every 1.5 seconds or so.  I believe the time varies slightly, but I'm not sure.
> - If I play at 92 bpm, the first nine notes appear.  The 1.5 second intervals are the same as with 120 bpm.
> - At 126 bpm I have less consistent results.  Most of the time it shows the first eight notes correctly, then it either drops either 14 or 15 notes and displays the two or three last ones.  Sometimes the behaviour is even stranger.  The program simply shows garbage, even notes that I never played.  That looks more like a bug in the DOS program, but I never heard reports about such a bug under native MS DOS.  Maybe the program simply does not "like" the way MIDI input is implemented in Dosemu.
>
> Sometimes the program hangs after inputting MIDI.  It does neither react to the keyboard nor to the mouse.  I just discovered that if I press some keys on the qwertz keyboard, they only appear if I press a key on the MIDI keyboard afterwards.  But the program does not accept any MIDI input any more.  The whole I/O seems to be messed up.
>
> If the program hangs, pressing some keys on the MIDI keyboard may trigger that some notes are shown, but those notes do not correspond with the pressed key.  I first suspected they are notes that were still in the input buffer, but at least sometimes it seems to me that it's complete garbage that can't have been in the buffer.  Sometimes two notes appear upon one keystroke, sometimes only one.  Sometimes it hangs completely and does not even respond to the MIDI keyboard any more.
>
> Maybe some background information can help finding a solution:  With DOS (or Windows), up to now, no user of this program has MIDI input working on a machine without ISA MIDI card.  Some of them even consider buying old used machines with ISA slots in order to work with MIDI input.  Output sometimes works fine, but input does not work at all without ISA.  What could be the cause for this?  What consequences might it have for running the program in Dosemu?  Dosemu could be an option for many users if MIDI input actually worked.
>
> I still don't give up hope, though it looks almost impossible to get this working properly.
Well, it would help most if I have the program here myself. What is it 
and where can I find it ?

I'm guessing there may also be timer issues.

Btw, one advantage of systems like JAD or 64 Studio is that they've 
already addressed the latency stuff. Perhaps Ubuntu Studio would be 
another thing to try ?

Best,

dp


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: MIDI input
@ 2008-06-18 13:09 x.zupftom
  2008-06-18 13:37 ` Dave Phillips
  0 siblings, 1 reply; 17+ messages in thread
From: x.zupftom @ 2008-06-18 13:09 UTC (permalink / raw)
  To: Dave Phillips; +Cc: linux-msdos

> -----Ursprüngliche Nachricht-----
> Von: "Dave Phillips" <dlphillips@woh.rr.com>

> x.zupftom@web.de wrote:
> > I'm using Ubuntu 8.04 "Hardy" AMD64 on a dual core machine.
> >   
> That's likely a plain-vanilla kernel. See if there's a low-latency 
> kernel for that system, it might help.
> 

I tried a realtime kernel, but unfortunately it makes absolutely no difference.

> Well, it would help most if I have the program here myself. What is it 
> and where can I find it ?
> 

I'm afraid I'm not allowed to pass it on, though this would indeed greatly simplify things.  Yes, it's still sold and used by many music typesetters working for major music publishing houses.  It costs 800 EUR here in Germany (see http://www.atemposoft.com/Shop/dept_8.html).

But I tried installing Sequencer Plus Gold to see whether it's the program that causes the problems or my setup.  But for some reason I can not install the drivers.  If the installer attempts to read the driver disk 1, the Dosemu window always closes.  I tried installing both the program and the drivers together as well as the drivers only.  However, the file vapimpu.com, which seems to be the driver needed, is already in the C:\voyetra folder.  I can start spg, but it tells me "VAPI DRIVER NOT INSTALLED. Press any key to continue the demo that won't play or record".  Adding C:\voyetra to the path variable didn't help.

These are the files in the voyetra folder:
  bashelp.seq
  help.ins
  miditest.exe
  spg_410.ov2
  spg.pif
  vapimpu.com
  call.com
  instment.lib
  spg_410.ov1
  spg.exe
  sp.ico

Could you maybe send me your voyetra folder (privately) so I can see whether this would work?

It's great to have someone who is experienced with MIDI input in Dosemu!

Thomas W.
_______________________________________________________________________
Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 30 Tage
kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc=022220

--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: MIDI input
  2008-06-18 13:09 x.zupftom
@ 2008-06-18 13:37 ` Dave Phillips
  0 siblings, 0 replies; 17+ messages in thread
From: Dave Phillips @ 2008-06-18 13:37 UTC (permalink / raw)
  To: x.zupftom; +Cc: linux-msdos

x.zupftom@web.de wrote:
>> -----Ursprüngliche Nachricht-----
>> Von: "Dave Phillips" <dlphillips@woh.rr.com>
>> ... it would help most if I have the program here myself. What is it and where can I find it ?
>>
>>     
>
> I'm afraid I'm not allowed to pass it on, though this would indeed greatly simplify things.  Yes, it's still sold and used by many music typesetters working for major music publishing houses.  It costs 800 EUR here in Germany (see http://www.atemposoft.com/Shop/dept_8.html).
>   
Ah yes, Leland Smith's famous Score. I know about the program, and there 
is some history with it and DOSemu. Alas, as you point out, Score is 
very expensive and I'm unable to test it myself.

> But I tried installing Sequencer Plus Gold to see whether it's the program that causes the problems or my setup.  But for some reason I can not install the drivers.  If the installer attempts to read the driver disk 1, the Dosemu window always closes.  I tried installing both the program and the drivers together as well as the drivers only.  However, the file vapimpu.com, which seems to be the driver needed, is already in the C:\voyetra folder.  I can start spg, but it tells me "VAPI DRIVER NOT INSTALLED. Press any key to continue the demo that won't play or record".  Adding C:\voyetra to the path variable didn't help.
>
> These are the files in the voyetra folder:
>   bashelp.seq
>   help.ins
>   miditest.exe
>   spg_410.ov2
>   spg.pif
>   vapimpu.com
>   call.com
>   instment.lib
>   spg_410.ov1
>   spg.exe
>   sp.ico
>
> Could you maybe send me your voyetra folder (privately) so I can see whether this would work?
>   
You're good already. Here's what you need to do now:

After starting DOSemu go into the directory where you have the vapimpu 
driver. Start the driver like this:

vapimpu

If it succeeds, you're ready to rock, and you can launch SPG. If it 
fails with a message about a bad or wrong IRQ, try this:

vapimpu /IRQ:n

where n equals some  IRQ number (try 5, 3, or 7). There are other 
considerations to make if that doesn't work, but give it a try first.

> It's great to have someone who is experienced with MIDI input in Dosemu!
>   
DOSemu was one of the reasons I switched to Linux. I'm a long-term user 
of Sequencer Plus, and I was never happy with Windows-based MIDI 
sequencers. When I discovered that SPG would run under DOSemu I was 
ecstatic, and that was with version 0.66. :)  Since then I've been very 
happy and productive with this arrangement. I've used SPG as my 
sequencer-of-choice for since 1986, first on MS-DOS, then under DOSemu 
for the past thirteen years.

You appear to have everything set up correctly, so let me know if you 
get things working or not.

Best,

dp

--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: MIDI input
@ 2008-06-18 20:47 x.zupftom
  2008-06-18 22:09 ` Dave Phillips
  0 siblings, 1 reply; 17+ messages in thread
From: x.zupftom @ 2008-06-18 20:47 UTC (permalink / raw)
  To: Dave Phillips; +Cc: linux-msdos

> -----Ursprüngliche Nachricht-----
> Von: "Dave Phillips" <dlphillips@woh.rr.com>
> 
> After starting DOSemu go into the directory where you have the vapimpu 
> driver. Start the driver like this:
> 
> vapimpu
> 
> If it succeeds, you're ready to rock, and you can launch SPG.

Thanks a lot!  That worked perfectly!  I could record and play back, with perfect timing and no delay.  The MIDI is always in sync with the PC speaker metronome beep.  So the setup is perfect, even with a plain vanilla kernel.

There is clearly a big difference in how both programs are reading MIDI data.  If I use the S debugging switch with SPG, there is so much debugging output that it runs pretty fast through the output window.  Here is a random extract of the output while I play notes at 240 bpm on the MIDI keyboard:

MPU401: Write 0xf8 to data port
MPU401: Read status port = 0xbf
MPU401: Write 0xf8 to data port
MPU401: Read status port = 0xbf
MPU401: Write 0xf8 to data port
MPU401: Read status port = 0xbf
MPU401: Write 0xf8 to data port
MPU401: Read status port = 0xbf
MPU401: Write 0xf8 to data port
MPU401: Processing IO callback, 1 bytes
SB: Activating irq type 4
SB: Interrupt activated.
SB: Activated IRQ for MIDI
MPU401: Read status port = 0x3f
MPU401: Read status port = 0x3f
MPU401: Read data port = 0xfe, 0 bytes still in queue
MPU401: Read status port = 0xbf
MPU401: Read status port = 0xbf
MPU401: Read status port = 0xbf
MPU401: Write 0xf8 to data port
MPU401: Read status port = 0xbf
MPU401: Write 0xf8 to data port
MPU401: Processing IO callback, 3 bytes
SB: Activating irq type 4
SB: Interrupt activated.
SB: Activated IRQ for MIDI
MPU401: Read status port = 0x3f
MPU401: Read status port = 0x3f
MPU401: Read data port = 0x90, 2 bytes still in queue
MPU401: Read status port = 0x3f
MPU401: Read data port = 0x3c, 1 bytes still in queue
MPU401: Read status port = 0x3f
MPU401: Read data port = 0x4e, 0 bytes still in queue
MPU401: Read status port = 0xbf
MPU401: Read status port = 0xbf
MPU401: Read status port = 0xbf
MPU401: Write 0xf8 to data port
MPU401: Processing IO callback, 3 bytes
SB: Activating irq type 4
SB: Interrupt activated.
SB: Activated IRQ for MIDI
MPU401: Read status port = 0x3f
MPU401: Read status port = 0x3f
MPU401: Read data port = 0x80, 2 bytes still in queue
MPU401: Read status port = 0x3f
MPU401: Read data port = 0x40, 1 bytes still in queue
MPU401: Read status port = 0x3f
MPU401: Read data port = 0x40, 0 bytes still in queue
MPU401: Read status port = 0xbf
MPU401: Read status port = 0xbf
MPU401: Read status port = 0xbf
MPU401: Write 0xf8 to data port
MPU401: Read status port = 0xbf
MPU401: Write 0xf8 to data port
MPU401: Read status port = 0xbf
MPU401: Write 0xf8 to data port

Now a random extract for the Score program, same notes played at the same speed.  As I wrote, this is a random extract - it does not represent a time interval that is similar to the above output.  However I suspect that the time interval between the lines saying "MPU401: Processing IO callback, ... bytes" should be about equal.

SB: Activating irq type 4
SB: Interrupt activated.
SB: Activated IRQ for MIDI
MPU401: Read status port = 0x3f
MPU401: Read data port = 0x48, 29 bytes still in queue
MPU401: Processing IO callback, 3 bytes
SB: Activating irq type 4
SB: Interrupt activated.
SB: Activated IRQ for MIDI
MPU401: Read status port = 0x3f
MPU401: Read data port = 0x4d, 31 bytes still in queue
MPU401: Processing IO callback, 1 bytes
SB: Activating irq type 4
SB: Interrupt activated.
SB: Activated IRQ for MIDI
MPU401: Read status port = 0x3f
MPU401: Read data port = 0x80, 31 bytes still in queue
MPU401: Processing IO callback, 3 bytes
SB: Activating irq type 4
SB: Interrupt activated.
SB: Activated IRQ for MIDI
MPU401: Read status port = 0x3f
MPU401: Read data port = 0x4c, 33 bytes still in queue
MPU401: Processing IO callback, 3 bytes
SB: Activating irq type 4
SB: Interrupt activated.
SB: Activated IRQ for MIDI
MPU401: Read status port = 0x3f
MPU401: Read data port = 0x40, 35 bytes still in queue
MPU401: Processing IO callback, 1 bytes
SB: Activating irq type 4
SB: Interrupt activated.
SB: Activated IRQ for MIDI
MPU401: Read status port = 0x3f


This output comes much slower than that of SPG (you can see that from the lines "MPU401: Processing IO callback, ... bytes" that I mentioned above which are much denser here).  I assume there are far too few lines saying "MPU401: Read status port = 0x3f", so there is a pretty high number of bytes still in the queue.  What is responsible for reading from that buffer?  Is it the DOS program, FreeDOS or Dosemu?  On "real" (non virtual) systems with old hardware and MS DOS the MIDI input apparently works with Score.  What does a "real" system with MS DOS do that Dosemu/FreeDOS don't?  I'm wondering whether I should try installing MS DOS in Dosemu...  How can I do this without damage to the nicely running FreeDOS?  (I have MS DOS 6.2 here.)

Thomas W.
______________________________________________________________
Jeden Monat 1 hochkarätiger maxdome-Blockbuster GRATIS!
Exklusiv für alle WEB.DE Nutzer. http://www.blockbuster.web.de

--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: MIDI input
  2008-06-18 20:47 x.zupftom
@ 2008-06-18 22:09 ` Dave Phillips
  0 siblings, 0 replies; 17+ messages in thread
From: Dave Phillips @ 2008-06-18 22:09 UTC (permalink / raw)
  To: x.zupftom; +Cc: linux-msdos

x.zupftom@web.de wrote:
>> -----Ursprüngliche Nachricht-----
>> Von: "Dave Phillips" <dlphillips@woh.rr.com>
>>
>> After starting DOSemu go into the directory where you have the vapimpu 
>> driver. Start the driver like this:
>>
>> vapimpu
>>
>> If it succeeds, you're ready to rock, and you can launch SPG.
>>     
>
> Thanks a lot!  That worked perfectly!  I could record and play back, with perfect timing and no delay.  The MIDI is always in sync with the PC speaker metronome beep.  So the setup is perfect, even with a plain vanilla kernel.
>   
Good to hear of it. :)

Btw, I've been testing DOSbox this afternoon. I get MIDI output, but no 
input yet. CPU usage is much lower than DOSemu, so I'm going to keep on 
testing it.


> There is clearly a big difference in how both programs are reading MIDI data.  If I use the S debugging switch with SPG, there is so much debugging output that it runs pretty fast through the output window.  Here is a random extract of the output while I play notes at 240 bpm on the MIDI keyboard: [snip]
>
>
> [Score's] output comes much slower than that of SPG (you can see that from the lines "MPU401: Processing IO callback, ... bytes" that I mentioned above which are much denser here).  I assume there are far too few lines saying "MPU401: Read status port = 0x3f", so there is a pretty high number of bytes still in the queue.  What is responsible for reading from that buffer?  Is it the DOS program, FreeDOS or Dosemu?  On "real" (non virtual) systems with old hardware and MS DOS the MIDI input apparently works with Score.  What does a "real" system with MS DOS do that Dosemu/FreeDOS don't?  I'm wondering whether I should try installing MS DOS in Dosemu...  How can I do this without damage to the nicely running FreeDOS?  (I have MS DOS 6.2 here.)
>   
I believe that SPG filters running status bytes, perhaps Score doesn't ? 
I'll guess that one problem is that there really wasn't a single device 
handler for the system, i.e. everyone wrote their own (hence the vapi 
drivers for Voyetra's hardware and MPU-compatibles). How do you 
configure Score for MIDI input, do you select a driver or does it have a 
default internal driver or ... ?

Best,

dp


--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: MIDI input
@ 2008-06-18 22:41 x.zupftom
  2008-06-19 12:11 ` Dave Phillips
  0 siblings, 1 reply; 17+ messages in thread
From: x.zupftom @ 2008-06-18 22:41 UTC (permalink / raw)
  To: Dave Phillips; +Cc: linux-msdos

> -----Ursprüngliche Nachricht-----
> Von: "Dave Phillips" <dlphillips@woh.rr.com>
> 
> Btw, I've been testing DOSbox this afternoon. I get MIDI output, but no 
> input yet.

I investigated that, too.  If memory serves me right, it has been said on some DOSbox mailing list that MIDI input is not implemented.

> I believe that SPG filters running status bytes, perhaps Score doesn't ? 

Sorry, but what does filtering status bytes mean?  Can it possibly be done before feeding the MIDI input to Score?

> How do you 
> configure Score for MIDI input, do you select a driver or does it have a 
> default internal driver or ... ?
> 

It must have an internal driver.  There are three configuration options:  The type of MIDI interface (you can chose between None, MPU-401 or compatible, Passport MIDI-Transport, IBM Music Feature and Yamaha C1), the IRQ level and the port address.

Thomas W.
_______________________________________________________________________
Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 30 Tage
kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc=022220

--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: MIDI input
  2008-06-18 22:41 x.zupftom
@ 2008-06-19 12:11 ` Dave Phillips
  0 siblings, 0 replies; 17+ messages in thread
From: Dave Phillips @ 2008-06-19 12:11 UTC (permalink / raw)
  To: x.zupftom; +Cc: linux-msdos

x.zupftom@web.de wrote:              
>> -----Ursprüngliche Nachricht-----											
>> Von: "Dave Phillips" <dlphillips@woh.rr.com>
>> I believe that SPG filters running status bytes, perhaps Score doesn't ? 
>>     
>
> Sorry, but what does filtering status bytes mean?  Can it possibly be done before feeding the MIDI input to Score?
>   
Running Status is a MIDI message, usually encountered in long strings of 
messages with the same status. According to the MIDI Programmer's 
Handbook, "It is the receiver's responsibility to identify and process 
Running Status transmissions."

The more I consider the problem, the more I think it may have something 
to do with Active Sensing bytes. An Active Sensing byte (hex FE) is sent 
every 300 ms if an instrument is idle, perhaps the message timing in 
your examples should be checked for their incidence ?

>   
>> How do you 
>> configure Score for MIDI input, do you select a driver or does it have a 
>> default internal driver or ... ?
>>
>>     
>
> It must have an internal driver.  There are three configuration options:  The type of MIDI interface (you can chose between None, MPU-401 or compatible, Passport MIDI-Transport, IBM Music Feature and Yamaha C1), the IRQ level and the port address.			
>   
DOSemu is likely to support only the MPU driver. Is that what you're using ?

Best,

dp

--
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: MIDI input
@ 2008-07-12 13:38 x.zupftom
  0 siblings, 0 replies; 17+ messages in thread
From: x.zupftom @ 2008-07-12 13:38 UTC (permalink / raw)
  To: Dave Phillips, x.zupftom; +Cc: linux-msdos

[-- Attachment #1: Type: text/plain, Size: 505 bytes --]

Hi all,

Stas Sergeev sent me a patch offlist that fixed my problem (see attachment). Thank you so much, Stas! Would anyone be so kind and apply it to the repository?

Thomas W.

P.S.: I thought I already sent this to the list some weeks ago, but the typical "reply vs. reply all" error happened.
_________________________________________________________________
WEB.DE schenkt Ihnen jeden Monat einen hochkarätigen Blockbuster 
von maxdome! Jetzt anmelden unter http://www.blockbuster.web.de


[-- Attachment #2: sb_irq3.diff --]
[-- Type: text/x-diff, Size: 4712 bytes --]

Index: src/dosext/sound/sound.c
===================================================================
--- src/dosext/sound/sound.c	(revision 1864)
+++ src/dosext/sound/sound.c	(working copy)
@@ -660,6 +660,8 @@
     S_printf("MPU401: Read data port = 0x%02x, %i bytes still in queue\n",
       r,Q_HOLDS(mpu401_info.data));
     sb_deactivate_irq(SB_IRQ_MIDI);
+    if (Q_HOLDS(mpu401_info.data))
+      sb_activate_irq(SB_IRQ_MIDI);
     break;
   case 1:
      /* Read status port */
Index: src/base/init/config.c
===================================================================
--- src/base/init/config.c	(revision 1864)
+++ src/base/init/config.c	(working copy)
@@ -302,9 +302,9 @@
 	}
     }
 
-    (*print)("\nSOUND:\nsb_base 0x%x\nsb_dma %d\nsb_hdma %d\nsb_irq %d\n"
+    (*print)("\nSOUND:\nengine %d\nsb_base 0x%x\nsb_dma %d\nsb_hdma %d\nsb_irq %d\n"
 	"mpu401_base 0x%x\nsb_dsp \"%s\"\nsb_mixer \"%s\"\nsound_driver \"%s\"\n",
-        config.sb_base, config.sb_dma, config.sb_hdma, config.sb_irq,
+        config.sound, config.sb_base, config.sb_dma, config.sb_hdma, config.sb_irq,
 	config.mpu401_base, config.sb_dsp, config.sb_mixer, config.sound_driver);
     (*print)("\nSOUND_OSS:\noss_min_frags 0x%x\noss_max_frags 0x%x\n"
 	     "oss_stalled_frags 0x%x\noss_do_post %d\noss_min_extra_frags 0x%x\n"
Index: src/base/dev/sb16/sb16.h
===================================================================
--- src/base/dev/sb16/sb16.h	(revision 1864)
+++ src/base/dev/sb16/sb16.h	(working copy)
@@ -83,6 +83,7 @@
 #define DSP_OUT_FIFO_TRIGGER 32
 #define DSP_IN_FIFO_TRIGGER 32
 #define MIDI_FIFO_SIZE 32
+#define MPU401_IN_FIFO_TRIGGER 1
   struct rng_s midi_fifo_in;
   struct rng_s midi_fifo_out;
   void *dspio;
Index: src/base/dev/sb16/sb16.c
===================================================================
--- src/base/dev/sb16/sb16.c	(revision 1864)
+++ src/base/dev/sb16/sb16.c	(working copy)
@@ -323,6 +323,14 @@
     return (sb.mixer_regs[0x82] & type);
 }
 
+static void sb_request_irq(int type)
+{
+    if (type & SB_IRQ_DSP)
+	pic_request(pic_irq_list[sb_get_dsp_irq_num()]);
+    if (type & SB_IRQ_MPU401)
+	pic_request(pic_irq_list[CONFIG_MPU401_IRQ]);
+}
+
 static void sb_activate_irq(int type)
 {
     S_printf("SB: Activating irq type %d\n", type);
@@ -330,10 +338,7 @@
 	S_printf("SB: Warning: Interrupt already active!\n");
 	return;
     }
-    if (type & SB_IRQ_DSP)
-	pic_request(pic_irq_list[sb_get_dsp_irq_num()]);
-    if (type & SB_IRQ_MPU401)
-	pic_request(pic_irq_list[CONFIG_MPU401_IRQ]);
+    sb_request_irq(type);
     sb.mixer_regs[0x82] |= type;
 }
 
@@ -351,6 +356,14 @@
     }
 }
 
+static void sb_run_irq(int type)
+{
+    if (!sb_irq_active(type))
+	return;
+    S_printf("SB: Run irq type %d\n", type);
+    sb_request_irq(type);
+}
+
 void sb_handle_dma(void)
 {
     sb.dma_count--;
@@ -528,7 +541,7 @@
 		/* for High-Speed mode reset means only exit High-Speed */
 		S_printf("SB: Reset called, exiting High-Speed DMA mode\n");
 		sb.dma_cmd = 0;
-	    } else if (sb_midi_input() && sb_midi_uart()) {
+	    } else if (sb_midi_uart()) {
 		S_printf("SB: Reset called, exiting UART midi mode\n");
 		sb.midi_cmd = 0;
 	    } else {
@@ -1134,7 +1147,7 @@
 
 	/* == DSP == */
     case 0x0C:			/* dsp write register */
-	if (sb_midi_input() && sb_midi_uart()) {
+	if (sb_midi_uart()) {
 	    sb_write_midi(value);
 	    break;
 	}
@@ -1200,8 +1213,11 @@
 	rng_get(&sb.dsp_queue, &value);
 	S_printf("SB: Read 0x%x from SB DSP\n", value);
 	result = value;
-	if (sb_midi_input() && sb_midi_int())
-	    sb_deactivate_irq(SB_IRQ_MIDI);
+	if (sb_midi_int()) {
+	    if (!rng_count(&sb.dsp_queue))
+		sb_deactivate_irq(SB_IRQ_MIDI);
+	    sb_run_irq(SB_IRQ_MIDI);
+	}
 	break;
 
     case 0x0C:			/* DSP Write Buffer Status */
@@ -1284,6 +1300,7 @@
 	     r, rng_count(&sb.midi_fifo_in));
 	if (!rng_count(&sb.midi_fifo_in))
 	    sb_deactivate_irq(SB_IRQ_MPU401);
+	sb_run_irq(SB_IRQ_MPU401);
 	break;
     case 1:
 	/* Read status port */
@@ -1357,8 +1374,10 @@
 	    process_sb_midi_input();
 	if (sb_midi_int())
 	    sb_activate_irq(SB_IRQ_MIDI);
-    } else if (sb.mpu401_uart)
-	sb_activate_irq(SB_IRQ_MPU401);
+    } else if (sb.mpu401_uart) {
+	if (rng_count(&sb.midi_fifo_in) == MPU401_IN_FIFO_TRIGGER)
+	    sb_activate_irq(SB_IRQ_MPU401);
+    }
 }
 
 void run_new_sb(void)
@@ -1382,7 +1401,7 @@
     io_device.handler_name = "Midi Emulation";
     io_device.start_addr = config.mpu401_base;
     io_device.end_addr = config.mpu401_base + 0x001;
-    io_device.irq = EMU_NO_IRQ;
+    io_device.irq = CONFIG_MPU401_IRQ;
     io_device.fd = -1;
     if (port_register_handler(io_device, 0) != 0)
 	error("MPU-401: Cannot registering port handler\n");


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2008-07-12 13:38 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-15  9:42 MIDI input x.zupftom
2008-06-16 16:38 ` Dave Phillips
  -- strict thread matches above, loose matches on Subject: below --
2008-07-12 13:38 x.zupftom
2008-06-18 22:41 x.zupftom
2008-06-19 12:11 ` Dave Phillips
2008-06-18 20:47 x.zupftom
2008-06-18 22:09 ` Dave Phillips
2008-06-18 13:09 x.zupftom
2008-06-18 13:37 ` Dave Phillips
2008-06-16 21:22 x.zupftom
2008-06-16 23:23 ` Dave Phillips
2008-06-13 21:54 x.zupftom
2008-06-13 18:09 x.zupftom
2008-06-12 23:47 x.zupftom
2008-06-13  0:50 ` Dave Phillips
2008-06-12 22:12 x.zupftom
2008-06-12 22:57 ` Tony Borras

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox