Login  •  Register


The time is now: Wed Dec 11, 2019 7:23 pm

Emaculation wiki  •  Delete all board cookies



Post new topic  Reply to topic Page 1 of 1 [ 8 posts ]
Print view Previous topic  |  Next topic
Author Message
 Post subject: Midi for Mini vMac
PostPosted: Sun Nov 03, 2019 9:34 pm 
Offline
Space Cadet

Joined: Sun Nov 03, 2019 9:11 pm
Posts: 3
Hi, i've implemented a midi bridge for Mini vMac which exposes emulator modem and printer midi ports to the host OS. so far no stuck notes, and sysex seems to work both ways. there's systematic jitter though which needs to be resolved. i can share an experimental OSX build if there's interest ?

here's a screenshot: https://drive.google.com/file/d/17zGJyVF4Az-3sstdZebDKZFHjlKCbWyi


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: Midi for Mini vMac
PostPosted: Mon Nov 04, 2019 4:36 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2754
Location: Emaculation.com
Wow! That's great! I can't guarantee when I'll be able to test it, but I'll definitely fire up DMCS and give it a go. I'll also see if I can patch it through to macOS's Bluetooth MIDI stack and see if it'll cooperate with other MIDI devices :)


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: Midi for Mini vMac
PostPosted: Tue Nov 05, 2019 7:57 pm 
Offline
Expert User
User avatar

Joined: Fri Feb 13, 2004 8:59 am
Posts: 4716
Location: Sittard, The Netherlands
Please do share a link to a build.

Best
Cat_7


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: Midi for Mini vMac
PostPosted: Tue Nov 05, 2019 10:36 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2754
Location: Emaculation.com
I just realized: this solution also means that we have a fully working null modem connection between Mini vMac and the host! That means you can connect the two with a terminal emulator like ZTerm to do file transfers, and even *easily* (since the other LocalTalk bits were already added to Mini vMac years ago) put two or more instances on a LocalTalk network, along with the LocalTalk server one of our forum members created a few years back.

So while the MIDI is a huge boon, the other serial features required to make this work mean that there's more that's functioning properly now too :)

Let me know when it's stable enough for me to put it through its paces on macOS (I'm currently running Catalina, but I can run it in any Mac OS needed).

I have dreams of running DMCS on the back end, and patching it into Garage Band via the Audio/MIDI setup :D


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: Midi for Mini vMac
PostPosted: Thu Nov 07, 2019 11:41 pm 
Offline
Space Cadet

Joined: Sun Nov 03, 2019 9:11 pm
Posts: 3
uploaded a zipped osx build v01 to https://drive.google.com/open?id=1OJ2GE87GE5VPFr8nKZcFwSwJXZDvykxM

any feedback/issues most welcome. would really like to turn it into a usable midi resource, thanks for trying it out!

explored most compilation options and ended up with the flags below: MacII target (because of 68020, please use MacII.ROM instead of vMac.ROM), legacy screen resolution as some early apps did not enjoy 16:10 too much, max emulation accuracy just in case, and background mode active by default. it is an unsigned build. unfortunately i've still been unable to tame the jitter. hope to reach paul c. pratt for more insights on where to look.

Code:
-t mc64 -m II -hres 640 -vres 480 -em-cpu 2 -ta 2 -bg 1 -d s -sgn 0


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: Midi for Mini vMac
PostPosted: Fri Nov 08, 2019 12:32 pm 
Offline
Space Cadet

Joined: Sun Nov 03, 2019 9:11 pm
Posts: 3
@adespoton: that's a great idea, didn't think about other serial port use cases. it would be pretty easy to open a tcp socket at Mini vMac side to expose raw serial port byte streams (ie. modem/printer in and out sans midi packet parsing).


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: Midi for Mini vMac
PostPosted: Fri Nov 08, 2019 4:12 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2754
Location: Emaculation.com
Might be worth posting on Paul's feedback page; I've sent him my debug details that way before, and he's got back to me in reasonably short order :) Of course, posting on here means he'll look at it eventually... but it could be a month or two.


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: Midi for Mini vMac
PostPosted: Fri Nov 15, 2019 2:33 pm 
Offline
Nice Guy
User avatar

Joined: Sat Nov 17, 2007 6:46 pm
Posts: 106
From https://www.gryphel.com/c/mail/v9.html#m176:

I can think of two reasons for such jitter. First, OS X is not a real time operating system. The operating system will give Mini vMac time to run when it feels like it. To get uninterrupted output for the emulation of built in sound, there is a buffer that the operating system can get samples from, even if Mini vMac doesn’t get time for a while. (This buffering results in lag, which can be a problem such as for games, so Mini vMac dynamically tries to figure out just how much buffering is needed.) But this is probably not the main issue you are seeing.

Second, Mini vMac emulates an entire tick, about a sixtieth of a second (more accurately 60.15), all at once. If the operating system feels like it and runs Mini vMac exactly on schedule, this will run every sixtieth (about 0.0167 seconds). Your emulated Midi clock events are supposed to happen somewhat less frequently. So in most ticks one event is emulated, but occasionally there are no events in a tick. Which is exactly what you are observing.

The only way to avoid this would be to have the operating system run Mini vMac much more frequently, and each time emulate small pieces of a tick. This would be much less efficient, and it is doubtful whether many operating systems would even allow this.

If possible, a better option is to buffer output, like the emulation of built sound does.


Top
 Profile  
Reply with quote Post a reply  
Display posts from previous:  Sort by  
Post new topic  Reply to topic Page 1 of 1 [ 8 posts ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
 

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group