VOGONS


DOSBox ECE (for Windows & Linux)

Topic actions

Reply 1420 of 1424, by Ringding

User metadata
Rank Member
Rank
Member

When I tested v14 of the patch yesterday – using the svn revision it was published against (r4294), I created a one-track cue file with one Opus track and used SJGPlay to play it. Interestingly, the player would show 2 tracks in the v14 version, with track 2 producing errors when trying to play it. The same does not happen in v13 against its respective svn revision, and also not in dosbox-staging. They show only one track, as I would expect.

Reply 1421 of 1424, by Ringding

User metadata
Rank Member
Rank
Member

I did the merge onto r4471 here: https://github.com/Ringdingcoder/dosbox-stagi … /cdda-v14-merge

You can download a patch like this if you want to: https://github.com/Ringdingcoder/dosbox-stagi … -v14-merge.diff

Reply 1422 of 1424, by SedrynTyros

User metadata
Rank Member
Rank
Member
Ringding wrote on 2022-01-14, 00:10:

I did the merge onto r4471 here: https://github.com/Ringdingcoder/dosbox-stagi … /cdda-v14-merge

You can download a patch like this if you want to: https://github.com/Ringdingcoder/dosbox-stagi … -v14-merge.diff

Awesome! Thanks so much. Looking forward to trying it out.

Reply 1423 of 1424, by Giuliano

User metadata
Rank Newbie
Rank
Newbie

Hello everyone,

This question is regarding emulation of Roland MT-32 and CM-32L on DOSBox-ECE.

Researching the web, I've found that the sampling rate of a Roland MT-32 is 32000 Hz. But DOSBox-ECE's config.conf brings:

[midi]
mt32.rate = 44100

Can this mismatch of sampling rates cause inaccuracies in the sound being played?

Cheers!

Reply 1424 of 1424, by morphinejh

User metadata
Rank Newbie
Rank
Newbie
Giuliano wrote on 2022-01-18, 15:09:
Hello everyone, […]
Show full quote

Hello everyone,

This question is regarding emulation of Roland MT-32 and CM-32L on DOSBox-ECE.

Researching the web, I've found that the sampling rate of a Roland MT-32 is 32000 Hz. But DOSBox-ECE's config.conf brings:

[midi]
mt32.rate = 44100

Can this mismatch of sampling rates cause inaccuracies in the sound being played?

Cheers!

I found this an interesting questions as well, so I investigated myself.

TLDR:
The output of the synth is internally set to 32000hz. It is then resampled if desired. So any sound artifacts would be minimal to none depending on the rate chosen. You should probably choose a rate supported by your sound card, which would have to do the conversion anyway.

Whole story:
DosboxECE uses the mt32emu library for MT-32 emulation. That library is called from within-
midi_mt32.cpp

74	int sampleRate = section->Get_int("mt32.rate");
75 service->setStereoOutputSampleRate(sampleRate);

Then within mt32emu interface, the cpp_interface.h calls the-

c_interface.h

c_interface.h
/**
* Allows to convert the synthesiser output to any desired sample rate. The samplerate conversion
* processes the completely mixed stereo output signal as it passes the analogue circuit emulation,
* so emulating the synthesiser output signal passing further through an ADC. When the samplerate
* argument is set to 0, the default output sample rate is used which depends on the current
* mode of analog circuitry emulation. See mt32emu_analog_output_mode.
* This function doesn't immediately change the state of already opened synth.
* Newly set value will take effect upon next call of mt32emu_open_synth().
*/
MT32EMU_EXPORT void mt32emu_set_stereo_output_samplerate(mt32emu_context context, const double samplerate);

...that code calls the SampleRateConverter class which eventually calls this-
SampleRateConverter.h

// Fills the provided output buffer with the results of the sample rate conversion.
// The input samples are automatically retrieved from the synth as necessary.
void getOutputSamples(float *buffer, unsigned int length);

// Returns the number of samples produced at the internal synth sample rate (32000 Hz)
// that correspond to the number of samples at the target sample rate.
// Intended to facilitate audio time synchronisation.
double convertOutputToSynthTimestamp(double outputTimestamp) const;