Hatari MIDI support

A forum about the Hatari ST/STE/Falcon emulator - the current version is v2.1.0

Moderators: simonsunnyboy, thothy, Moderator Team

607
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 128
Joined: Tue Aug 16, 2016 3:20 pm
Location: Amersfoort, the Netherlands

Hatari MIDI support

Postby 607 » Sat Mar 11, 2017 6:37 pm

Is there a way to use a MIDI keyboard with Hatari?

User avatar
farvardin
Captain Atari
Captain Atari
Posts: 366
Joined: Fri Jan 01, 2010 5:50 pm
Location: France
Contact:

Re: Hatari MIDI support

Postby farvardin » Sat Mar 11, 2017 8:19 pm

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.

User avatar
frank.lukas
Hardware Guru
Hardware Guru
Posts: 1616
Joined: Tue Jan 29, 2008 5:33 pm
Location: Germany

Re: Hatari MIDI support

Postby frank.lukas » Sat Mar 11, 2017 8:32 pm

OSX/macOS is also a BSD like OS and there is a/dev device folder too ...
fancy Atari Musik anDA Dance "Agare Hinu Harukana" 1998 ATARI http://www.youtube.com/watch?v=JX10fxb5eYE

Faucon2001
Atari Super Hero
Atari Super Hero
Posts: 707
Joined: Sat Oct 26, 2013 11:19 pm
Location: Brasil
Contact:

Re: Hatari MIDI support

Postby Faucon2001 » Sat Mar 11, 2017 10:30 pm

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.
Philippe

Firebee, Falcon, STE, Aranym Box, Hatari Pi Box.
My music http://www.philippeworld.net/
My photography http://phil-67.deviantart.com/
EasyAraMint, BeeKey and BeePi https://sites.google.com/site/emaappsarch/home

siriushardware
Captain Atari
Captain Atari
Posts: 401
Joined: Thu Aug 21, 2014 7:55 pm
Location: UK

Re: Hatari MIDI support

Postby siriushardware » Tue Mar 14, 2017 6:27 pm

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.

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1729
Joined: Sun Jul 31, 2011 1:11 pm

Re: Hatari MIDI support

Postby Eero Tamminen » Tue Mar 14, 2017 8:22 pm

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.

User avatar
farvardin
Captain Atari
Captain Atari
Posts: 366
Joined: Fri Jan 01, 2010 5:50 pm
Location: France
Contact:

Re: Hatari MIDI support

Postby farvardin » Tue Mar 14, 2017 9:19 pm

Once I connected my keyboard with hatari running the Maxymiser tracker, and it was pleasant to use it as a synth!

siriushardware
Captain Atari
Captain Atari
Posts: 401
Joined: Thu Aug 21, 2014 7:55 pm
Location: UK

Re: Hatari MIDI support

Postby siriushardware » Wed Mar 15, 2017 8:08 pm

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.

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1729
Joined: Sun Jul 31, 2011 1:11 pm

Re: Hatari MIDI support

Postby Eero Tamminen » Thu Mar 16, 2017 7:16 pm

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...

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1729
Joined: Sun Jul 31, 2011 1:11 pm

Re: Hatari MIDI support

Postby Eero Tamminen » Tue Oct 03, 2017 6:58 pm

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.

607
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 128
Joined: Tue Aug 16, 2016 3:20 pm
Location: Amersfoort, the Netherlands

Re: Hatari MIDI support

Postby 607 » Fri Oct 13, 2017 6:45 pm

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.

User avatar
edingacic
Captain Atari
Captain Atari
Posts: 244
Joined: Mon Sep 07, 2015 5:16 pm
Location: Austria
Contact:

Re: Hatari MIDI support

Postby edingacic » Sat Nov 04, 2017 3:21 am

so what is needed to make it work for osx is there a simple setup I don't get it :)

User avatar
edingacic
Captain Atari
Captain Atari
Posts: 244
Joined: Mon Sep 07, 2015 5:16 pm
Location: Austria
Contact:

Re: Hatari MIDI support

Postby edingacic » Sat Nov 04, 2017 4:27 am

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?
You do not have the required permissions to view the files attached to this post.

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1729
Joined: Sun Jul 31, 2011 1:11 pm

Re: Hatari MIDI support

Postby Eero Tamminen » Sat Nov 04, 2017 7:19 pm

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/

woland360
Atarian
Atarian
Posts: 3
Joined: Mon Jan 15, 2018 5:39 am

Re: Hatari MIDI support

Postby woland360 » Wed Apr 04, 2018 11:59 pm

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.

kolli
Atari User
Atari User
Posts: 42
Joined: Sat Jul 23, 2016 7:37 pm

Re: Hatari MIDI support

Postby kolli » Thu Apr 05, 2018 11:27 am

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.

woland360
Atarian
Atarian
Posts: 3
Joined: Mon Jan 15, 2018 5:39 am

Re: Hatari MIDI support

Postby woland360 » Thu Apr 05, 2018 12:57 pm

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.

User avatar
Eero Tamminen
Atari God
Atari God
Posts: 1729
Joined: Sun Jul 31, 2011 1:11 pm

Re: Hatari MIDI support

Postby Eero Tamminen » Thu Apr 05, 2018 10:45 pm

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.
Last edited by Eero Tamminen on Sat Apr 07, 2018 3:02 pm, edited 1 time in total.

woland360
Atarian
Atarian
Posts: 3
Joined: Mon Jan 15, 2018 5:39 am

Re: Hatari MIDI support

Postby woland360 » Fri Apr 06, 2018 12:25 pm

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!

User avatar
Foxie
Captain Atari
Captain Atari
Posts: 354
Joined: Wed Feb 03, 2016 7:12 pm

Re: Hatari MIDI support

Postby Foxie » Fri Apr 06, 2018 3:19 pm

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.

IrataMule
Atarian
Atarian
Posts: 2
Joined: Mon May 14, 2018 7:49 pm

Re: Hatari MIDI support

Postby IrataMule » Mon May 14, 2018 8:07 pm

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.

siriushardware
Captain Atari
Captain Atari
Posts: 401
Joined: Thu Aug 21, 2014 7:55 pm
Location: UK

Re: Hatari MIDI support

Postby siriushardware » Wed May 16, 2018 10:28 am

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.

IrataMule
Atarian
Atarian
Posts: 2
Joined: Mon May 14, 2018 7:49 pm

Re: Hatari MIDI support

Postby IrataMule » Wed May 16, 2018 2:47 pm

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.


Social Media

     

Return to “Hatari”

Who is online

Users browsing this forum: No registered users and 1 guest