Page 1 of 1

Hatari MIDI support

Posted: Sat Mar 11, 2017 6:37 pm
by 607
Is there a way to use a MIDI keyboard with Hatari?

Re: Hatari MIDI support

Posted: Sat Mar 11, 2017 8:19 pm
by farvardin
yes, if you're using Linux :

http://hatari.tuxfamily.org/docs.html

Q: How can I use MIDI on Mac OS X or Windows?

A: MIDI currently only works on Linux (and maybe some *BSD systems) where Hatari can write the MIDI output to a device file in the /dev file system. On all other systems, MIDI is not supported.

Re: Hatari MIDI support

Posted: Sat Mar 11, 2017 8:32 pm
by frank.lukas
OSX/macOS is also a BSD like OS and there is a/dev device folder too ...

Re: Hatari MIDI support

Posted: Sat Mar 11, 2017 10:30 pm
by Faucon2001
With a standard USB class compliant midi interface, configure Hatari to access the right /dev/snd/midi*** for input and output.
It works for me under Linux with a Maudio keyboard or a Roland SC8850 and Cubase 3. I have never tried under OSX.

Re: Hatari MIDI support

Posted: Tue Mar 14, 2017 6:27 pm
by siriushardware
See also this recent similar thread:

viewtopic.php?f=51&t=27649

Before 1.9.0, MIDI support on Hatari, even on the Linux version, didn't work too well, but from 1.9.0 MIDI support / functionality improved dramatically.

Part of the way through the development of V1.9, a specific tweak was also added to get around an incompatibility with the most popular versions of Cubase 2 (there was a problem with Cubase falling over when you navigated into any of the editor sub-screens) - since then I have been able to run Cubase 2 as well under Linux Hatari as on a real ST, which is really saying something if you know how smoothly Cubase 2 works on a real ST.

The current stable Linux version V2.0.0 presumably incorporates all of these improvements carried over from V1.9 - V2.0 is the one I'm using now, anyway.

Re: Hatari MIDI support

Posted: Tue Mar 14, 2017 8:22 pm
by Eero Tamminen
MIDI output (Linux) support was added to Hatari v0.45 (2003), and MIDI input support to Hatari v1.2 (2009), from which point MIDI music output has worked pretty well (= was tested more extensively) e.g. in games.

There were additional fixes for different Cubase versions in Hatari v1.7 & v1.9, and as mentioned above, it was fixed for good for Cubase in v2.0. Some of those fixes were also needed by BadMood, Douglas' Doom game rewrite for Falcon.

Re: Hatari MIDI support

Posted: Tue Mar 14, 2017 9:19 pm
by farvardin
Once I connected my keyboard with hatari running the Maxymiser tracker, and it was pleasant to use it as a synth!

Re: Hatari MIDI support

Posted: Wed Mar 15, 2017 8:08 pm
by siriushardware
Eero Tamminen wrote:MIDI output (Linux) support was added to Hatari v0.45 (2003), and MIDI input support to Hatari v1.2 (2009), from which point MIDI music output has worked pretty well (= was tested more extensively) e.g. in games.


I can only quote from the other thread I mentioned, in which (at the time) Nicolas (npomarede) was referring to V1.8....

npomarede wrote:..many improvements were made to midi timings in the current devel version, and they will be in Hatari 1.9.
When using Hatari 1.8, there's nothing you can do, it's not some settings problem, it's the emulation that was not accurate enough.


The problem I was having at the time was that Hatari V1.8 (no matter which MIDI software was involved) was only outputting MIDI data for a few seconds, then would stall. The program (sequencer, synth editor) would continue to run as though nothing had happened but no further MIDI data would be output until Hatari was restarted, after which the same problem could be repeated.

However, I must stress that the changes Nicolas made to midi.c during the continuing development of V1.8 completely fixed this problem and were incorporated into V1.9 stable, leaving only a specific problem when going into the edit sub-menus in Cubase 2.

This particular issue was very kindly and quickly fixed during development of V1.9 once I had flagged it up and Cubase is now as usable on Linux Hatari as it is on a real ST, for which I'm truly grateful.

Re: Hatari MIDI support

Posted: Thu Mar 16, 2017 7:16 pm
by Eero Tamminen
It's possible that it had regressed at some point. It had worked fine with all the games I tested (Midimaze for networking, Leisure Suit Larry & Empire for music output) and many free MIDI program's from Tim's MIDI world (midimouse was my favorite) and Sequencer One I had gotten from a ST Format cover disk.

I don't think MIDI input had really been properly tested again after that, until v1.8. Or if somebody did test, they didn't bother to inform Hatari developers about issue...

Re: Hatari MIDI support

Posted: Tue Oct 03, 2017 6:58 pm
by Eero Tamminen
farvardin wrote:yes, if you're using Linux :

http://hatari.tuxfamily.org/docs.html

Q: How can I use MIDI on Mac OS X or Windows?

A: MIDI currently only works on Linux (and maybe some *BSD systems) where Hatari can write the MIDI output to a device file in the /dev file system. On all other systems, MIDI is not supported.


FYI: Jari Klemola just provided MIDI support for OSX & Windows versions of Hatari:
https://listengine.tuxfamily.org/lists. ... 00000.html

Once somebody else verifies that it works also on Windows (not just on OSX & Linux), the support goes in.

Re: Hatari MIDI support

Posted: Fri Oct 13, 2017 6:45 pm
by 607
FYI: Jari Klemola just provided MIDI support for OSX & Windows versions of Hatari:
https://listengine.tuxfamily.org/lists. ... 00000.html

Once somebody else verifies that it works also on Windows (not just on OSX & Linux), the support goes in.

Ah, I'll try to remember to try! I haven't got MIDI set up at the moment, but I might be able to do so this weekend... not sure, though.

Re: Hatari MIDI support

Posted: Sat Nov 04, 2017 3:21 am
by edingacic
so what is needed to make it work for osx is there a simple setup I don't get it :)

Re: Hatari MIDI support

Posted: Sat Nov 04, 2017 4:27 am
by edingacic
Is it possible for me to somehow pass midi out to DLS Music Device that is built in every osx? I have some apps that play midi files using this sound font. I just want to have Cubase running in Hatari and being able to hear these virutal sound banks. Here is a screenshot of osx app that plays midi files fine using probably GeneralUser GS v1.471.sf2 soundbank?

Is it possible to pass cubase midi out to Apple DLSMusicDevice ? and how would I set it up in Hatari?

Re: Hatari MIDI support

Posted: Sat Nov 04, 2017 7:19 pm
by Eero Tamminen
I don't have Mac, but in general it should be enough to: select suitable MIDI interface from the Hatari GUI, and after that MIDI input/output should work fine. You may need to reboot emulation.

Troed has provided OSX build that includes the changes, if you cannot build Hatari from Mercurial yourself: https://troed.ddns.net/f/a44e383d76a446379312/

Re: Hatari MIDI support

Posted: Wed Apr 04, 2018 11:59 pm
by woland360
Hello, this is my first post on this forum,
I’m musician and I would like to start adventure with Atari ST/STE demoscene. I should also mention that new to Linux and emulation :(

I’ve installed Hatari 2.1.0 on my laptop (Linux Mint). I was able to configure MIDI emulation and everything works fine. Next I tried to do this on my Raspberry Pi 3B (updated Raspbian), to achieve better performance I’ve compiled Hatari on Rasp with SDL 1.2.

Now, the problem is that I can’t get MIDI emulation to work on Raspberry Pi. Rasp version will not allow me to browse for midi input/output file – I can only select virtual device or softsynth (https://imgur.com/njBugJW). If I try to output midi to ie. VirMIDI 1-0 and connect VirMIDI 1-0 to timidity or qsynth – it does not work (no error logs, no nothing). However, if I select qsynth or timidity as midi output in Hatari – I will hear only first played note (Program – Notator or Cubase wont stop playing, but sound just stops and if I would like to repeat this experiment – I would need to restart Hatari app).

I do not know what I’m doing wrong and what I could do to make it work on Raspbian. Or maybe it is just not good idea to use Raspberry Pi? I would be very grateful for any advice.

Re: Hatari MIDI support

Posted: Thu Apr 05, 2018 11:27 am
by kolli
I have tried it on Raspbian with not very good results. Didn't ran into the problems you have, but the performance of the PI 3B with my M-Audio USB MIDI interface was very bad. Lots of lost MIDI events. I think the shared USB Port of the PI is the bottle neck.

Re: Hatari MIDI support

Posted: Thu Apr 05, 2018 12:57 pm
by woland360
Hi Kolli, that's why I do not even try to use any external device :)

Funny, I just cloned v1.9.0 of Hatari and compiled it. In 1.9.0 on Raspbian I'm able to select file to write MIDI output (https://imgur.com/pkrubik), and as I connect VirMIDI to Qsynth - it works! Fact - Its not smooth, sound is a little laggy and distorted but its clearly issue with softsynth performance, not Hatari :)
As I would like to write compositions on more modern software and copy files to emulated Atari only to make sure that every sound can be played - I can live with that :)
I will eventualy think about configuring softsynth to consume less cpu or memory.

Re: Hatari MIDI support

Posted: Thu Apr 05, 2018 10:45 pm
by Eero Tamminen
Hatari v2.1 is normally built with PortMidi support, with that Hatari can connect directly to ALSA MIDI devices like QSynth. Just remember to start QSynth before Hatari, or it's not visible in the Hatari GUI MIDI setup lists.

Only older Hatari versions, and builds without PortMidi support require raw MIDI device file access (provided e.g. by kernel's virtual midi module, as explained in the midi-linux.txt document).

EDIT: minor clarifications to text.

Re: Hatari MIDI support

Posted: Fri Apr 06, 2018 12:25 pm
by woland360
Eero Tamminen, you saved my time, thanks!
It looks like PortMIDI does not work for me, so I build 2.1.0 without PM and I'm now able to use midi. Thanks again!

Re: Hatari MIDI support

Posted: Fri Apr 06, 2018 3:19 pm
by Foxie
kolli wrote:I have tried it on Raspbian with not very good results. Didn't ran into the problems you have, but the performance of the PI 3B with my M-Audio USB MIDI interface was very bad. Lots of lost MIDI events. I think the shared USB Port of the PI is the bottle neck.


USB MIDI is a complete disaster. Truly the worst thing to happen to music technology. It wasn't even developed by the MMA, they would never have made a standard that bad. It makes people think MIDI itself is responsible for loose timing, when really the problem is the USB interface and the protocol.

Luckily, the Pi has a set of UART pins on the expansion header. I believe there's a Linux driver available to turn these pins into MIDI I/O. You need a couple of transistors and a few resistors to get a MIDI output. MIDI input requires an optocoupler (H11L1). There might be a board you can buy with MIDI I/O, although most of those hobby-type MIDI projects tend to be badly designed and unsafe.

It would be interesting to see how accurate the timing can be on a Pi running Linux compared to an Atari. Unfortunately there are no professional Linux sequencers, so you're always better off with an Atari.

Re: Hatari MIDI support

Posted: Mon May 14, 2018 8:07 pm
by IrataMule
woland360 wrote:I’ve installed Hatari 2.1.0 on my laptop (Linux Mint). I was able to configure MIDI emulation and everything works fine.


You're way ahead of me. I had no such luck so far with Linux Mint 18.3, Hatari 2.1, qjackctl/a2jmidid and Cubase 2. MIDI in shows no signs of life at all, while MIDI out gives me an error message from portmidi about bad MIDI data that requires a keypress for confirmation (!) and subsequently causes Hatari to exit. Some kind of error handling! That didn't exactly raise my level of confidence in any solution based on this library. I even updated it from the 200 version in Mint 18.3 to Ubuntu's 217, but that has the same questionable code in it still and behaves in the exact same way. Meanwhile, the whole setup works just fine with Reaper, which tells me that the jack setup is solid. Does anybody have an idea of what might be going on? While that portmidi hack is certainly a concern, it is probably not the root cause of this error condition to be triggered in the first place.

Re: Hatari MIDI support

Posted: Wed May 16, 2018 10:28 am
by siriushardware
Foxie wrote:It would be interesting to see how accurate the timing can be on a Pi running Linux compared to an Atari. Unfortunately there are no professional Linux sequencers, so you're always better off with an Atari.


My guess without trying it would be: Atari 1, Linux 0, simply because the Atari OS (that I am familiar with) is a single tasking OS and desktop Linux is a multitasking OS which will therefore have many conflicting demands on its time. The ST is much better at focusing on a single task.

Re: Hatari MIDI support

Posted: Wed May 16, 2018 2:47 pm
by IrataMule
IrataMule wrote:
woland360 wrote:I had no such luck so far with Linux Mint 18.3, Hatari 2.1, qjackctl/a2jmidid and Cubase 2.


I'm happy to report that it all works just fine once you build Hatari without portmidi in.