VOGONS


First post, by sergm

User metadata
Rank Oldbie
Rank
Oldbie

mt32emu-Qt is an application featuring software synthesizer based on mt32emu library and Qt engine. It's aimed to have convenient & functional user interface being a cross-platform.

This topic is supposed to discuss UI-related issues, proposals, TODOs, bugs, feature requests, etc.

Reply 1 of 29, by sergm

User metadata
Rank Oldbie
Rank
Oldbie

@ ufoufo512:
As it comes to launching the subj on Mac platform, I'm most interesting in the timing quality of PortAudio driver. After you start the test MIDI driver, you get the sequence of numbers like this (output from my Win box):

M 270610 -21617 258
M 270866 -21617 256
M 271123 -27772 257
M 271380 -26243 257
M 271637 -19021 257
M 271893 -19021 256
M 272151 -18634 258
M 272407 -4645 256
M 272664 -22539 257
M 272920 -22539 256
M 273178 -26249 258
M 273435 -22227 257
M 273691 -22227 256
M 273948 -13763 257
M 274204 -117 256
M 274460 -117 256
M 274718 -18542 258
M 274975 -7801 257
M 275233 -12116 258
M 275489 -12116 256
M 275745 -17056 256
M 276003 -30697 258
M 276259 -30697 256
M 276516 -22193 257
M 276773 -7188 257
M 277030 -8455 257
M 277286 -8455 256
M 277543 -24409 257
M 277800 -10374 257
M 278056 -10374 256
M 278313 -22389 257
M 278572 -29118 259
M 278827 -1543 255
M 279083 -1543 256
M 279340 -18598 257
M 279597 -8927 257
M 279855 -17295 258
M 280111 -17295 256
M 280367 -3935 256
M 280625 -13982 258
M 280882 -23858 257
M 281138 -23858 256
M 281395 -17654 257
M 281653 -7228 258
M 281909 -7228 256
M 282165 -1051 256
Test processor finished

The test MIDI driver works like a MIDI generator which pushes test messages to the queue exactly every 256 samples (or 8 ms, since the sample rate is 32000 Hz).
In the table above, the third column presents the latency in nanoseconds since the test MIDI message was pushed to the queue until processed. The fourth column presents the difference in samples between the neighbor messages.
As you can see from the table shown, the synthesis timing on my system is almost sample-accurate, the fourth column values are very close to 256 which is perfect. The latencies in the third column are also far below 31 microseconds - the sample period corresponding our sample rate.

Reply 2 of 29, by Kaminari

User metadata
Rank Oldbie
Rank
Oldbie

The interface might take a wee bit too much space, but I like it a lot!

Could it be possible to save some kind of profiles (one profile per synth tab)? I'd like the Qt interface to remember some settings like the MIDI input and the DAC emulation mode.

Reply 3 of 29, by ufoufo512

User metadata
Rank Newbie
Rank
Newbie

On my MacBook Pro (i5) Mac OS X 10.6.8 almost all values are either 150 or 300.

Here is a small sample. I am willing to provide more information if needed. Just tell what you need.

M 921600 -1656366 150
M 921900 -3032904 300
M 922200 -4409441 300
M 922500 -5785979 300
M 922650 -2474248 150
M 922950 -3850786 300
M 923100 -539055 150
M 923400 -1915593 300

Reply 4 of 29, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

can anyone post a screenshot of it for interest sake? I'm not ready to setup a qt environment atm...

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 6 of 29, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

thanks, looks nice

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 7 of 29, by sergm

User metadata
Rank Oldbie
Rank
Oldbie

@ Kaminari:
You're right, it's definitely wide. But now for HD LCDs are everywhere, that isn't a problem, I think.

Thanks, I agree it'll be more convenient than re-open same ports at every program launch. I'll add auto-storing these synths settings soon.

@ ufoufo512:
Looks not good 😒 For your current configuration it looses rendering precision (max error is about 3 millis for the value of 150in the table). Though, not too bad, if it comes to playing MIDI file with PPQN 24 (in this case the granularity is about 20 millis), for example.

I'd like you to try increasing MIDI latency value in the audio properties dialog, it seems too low. To achieve the best timing accuracy, MIDI latency should overlap every audio jitter possible, thus it should be greater than audio latency value.

Could you inform the values of the audio and MIDI latencies the program reports at the start?

Reply 8 of 29, by ufoufo512

User metadata
Rank Newbie
Rank
Newbie

@sergm: All my latencies were zero in the Audio Output / Properities section. I don't know whether these were default values or did I play with them before. Also the program reports 0 ns for latency at start up.

Anyway, I played with different MIDI latency settings and around 4 the fourth column will start to should pretty constant 256 on my Mac.

Reply 9 of 29, by sergm

User metadata
Rank Oldbie
Rank
Oldbie

Great, that's a PortAudio bug then. Seems it uses 4 ms chunks for output and says audio latency is 0. Anyway, you should be fine with that setting and surely can play real MIDIs thru one or more sessions which could be separate or mixed into one synth (in case you want to load sysexes using one program and play a tune using another).

Reply 10 of 29, by ykhwong

User metadata
Rank Oldbie
Rank
Oldbie

Looks nice, sergm.
I noticed that cmake does not produce files for compilers with your qt branch(mt32emu-qt).
Also, can you provide a dosbox patch which loads the current mt32emu library, too? The existing patch for dosbox does not work with the latest munt probably due to the structural change.

Reply 11 of 29, by sergm

User metadata
Rank Oldbie
Rank
Oldbie
ykhwong wrote:

Looks nice, sergm.

Thanks, ykhwong 😀
Though, generally that's neither my idea nor basic GUI design. So, thanks should go to Jerome as well. 😉

I noticed that cmake does not produce files for compilers with your qt branch(mt32emu-qt).

Not sure what you mean here... 😒 Do you specify generator option in the cmake command line? For MinGW/MSYS this is somewhat weird. On posix boxes both master and mt32emu-qt branches compile with just

cmake . ; make

command. And for MinGW setup I use

cmake -G "MSYS Makefiles" .
make

Also, can you provide a dosbox patch which loads the current mt32emu library, too? The existing patch for dosbox does not work with the latest munt probably due to the structural change.

The synth engine in this version is identical to the one of master branch, so you shouldn't win anything by switching to it.
Moreover, it's not quite ready for the production use. Specifically, it recognizes (and works) with two sets of ROMs only: MT-32 v 1.07 87/10/10 and CM-32L 88/07/28. And AFAIK, KG wants to change ROM-related stuff further (though, I don't know when, m.b. even this year 😁).

Reply 12 of 29, by andy504

User metadata
Rank Newbie
Rank
Newbie

Hi-
I'm trying to compile mt32emu-qt on my iMac running OS X 10.7 Lion, and it fails at the end of the make process. I received the following error:

 [99%] Building CXX object mt32emu_qt/CMakeFiles/mt32emu-qt.dir/src/audiodrv/PortAudioDriver.cpp.o
cd /Volumes/Mac_USB_HD/Andy/Downloads/munt-munt-bda0620/mt32emu_qt && /usr/bin/c++ -DWITH_COREMIDI_DRIVER -DWITH_COREAUDIO_DRIVER -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DWITH_QT_AUDIO_DRIVER -DWITH_PORT_AUDIO_DRIVER -I/Volumes/Mac_USB_HD/opt/local/include -I/Volumes/Mac_USB_HD/opt/local/include/QtGui -I/Volumes/Mac_USB_HD/opt/local/include/QtCore -I/Volumes/Mac_USB_HD/Andy/Downloads/munt-munt-bda0620/mt32emu/include -I/Volumes/Mac_USB_HD/Andy/Downloads/munt-munt-bda0620/portaudio/include -I/Volumes/Mac_USB_HD/Andy/Downloads/munt-munt-bda0620/mt32emu_qt -o CMakeFiles/mt32emu-qt.dir/src/audiodrv/PortAudioDriver.cpp.o -c /Volumes/Mac_USB_HD/Andy/Downloads/munt-munt-bda0620/mt32emu_qt/src/audiodrv/PortAudioDriver.cpp
/Volumes/Mac_USB_HD/Andy/Downloads/munt-munt-bda0620/mt32emu_qt/src/audiodrv/PortAudioDriver.cpp:144:30: error:
no member named 'actualSampleRate' in 'PaStreamCallbackTimeInfo'
realSampleRate = timeInfo->actualSampleRate;
~~~~~~~~ ^

I don't know if this error is due to portaudio specifically, or something mt32emu-qt related. In case it has something to do with the portaudio library included in mt32emu-qt, I've installed it independently via Macports, but I can't seem to get Cmake to use it. If I set WITH_INTERNAL_PORTAUDIO to no I receive the following error.

CMake Error at mt32emu_qt/CMakeLists.txt:135 (check_include_files):
Unknown CMake command "check_include_files".

Do you know what flag or entry I could give Cmake to find the Macports installation of Portaudio? Of course, that's assuming that that's where the problem is, and I'm just not sure. Thanks. By the way, I'm using the latest source from Github. Any help is appreciated.

Reply 13 of 29, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

did you grab cmake through macports as well?
you could try whether running these lines before running cmake help

export CFLAGS=-I/opt/local/include
export LDFLAGS=-L/opt/local/lib
export CXXFLAGS=$CFLAGS
export CPPFLAGS=$CXXFLAGS
export ACLOCAL_FLAGS="-I /opt/local/share/aclocal"
export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig"

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 14 of 29, by andy504

User metadata
Rank Newbie
Rank
Newbie
Dominus wrote:
did you grab cmake through macports as well? you could try whether running these lines before running cmake help […]
Show full quote

did you grab cmake through macports as well?
you could try whether running these lines before running cmake help

export CFLAGS=-I/opt/local/include
export LDFLAGS=-L/opt/local/lib
export CXXFLAGS=$CFLAGS
export CPPFLAGS=$CXXFLAGS
export ACLOCAL_FLAGS="-I /opt/local/share/aclocal"
export PKG_CONFIG_PATH="/opt/local/lib/pkgconfig"

Yes, cmake was grabbed from Macports. I tried the export commands, same result.

Reply 15 of 29, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Maybe $CMAKE_PREFIX_PATH, $CMAKE_LIBRARY_PATH and $CMAKE_INCLUDE_PATH are for cmake.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 17 of 29, by sergm

User metadata
Rank Oldbie
Rank
Oldbie

Hi, guys.

I suspect the problem here is CMake uses include files from PortAudio distrib, whereas the sources hosted at GitHub contain PortAudio fork slightly honed. In particular, I added accurate sample rate computation and expose it through that actualSampleRate parameter of the timeInfo struct it originally lacks. So, if CMake makes a priority for distrib include files, you'll get this error. Though, I'm on my way to roll this computation back and making the workaround to estimate actual sample rate within the application. So, it's possible I'll remove this eventually.

Reply 19 of 29, by andy504

User metadata
Rank Newbie
Rank
Newbie
sergm wrote:

It seems, this issue is fixed now as well as another nasty problem with PortAudio timing inaccuracies

I can confirm this works, at leas on my system running OS X 10.7.3 and Xcode 4.3.2. Thanks, Dominus and sergm! 😀