Add preference to set PPQN of exported MIDI files

This also changes the default from 19200 to 1920
This commit is contained in:
Robin Gareus 2023-04-12 13:12:29 +02:00
parent f7f3c1a920
commit c3102ab8a5
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 5 additions and 2 deletions

View File

@ -281,3 +281,4 @@ CONFIG_VARIABLE (bool, show_video_server_dialog, "show-video-server-dialog", fal
/* export */
CONFIG_VARIABLE (float, export_preroll, "export-preroll", 2.0) // seconds
CONFIG_VARIABLE (float, export_silence_threshold, "export-silence-threshold", -90) // dB
CONFIG_VARIABLE (float, ppqn_factor_for_export, "ppqn-factor-for-export", 1) // Temporal::ticks_per_beat

View File

@ -18,9 +18,11 @@
#include <glib/gstdio.h>
#include "temporal/tempo.h"
#include "ardour/export_smf_writer.h"
#include "ardour/midi_buffer.h"
#include "temporal/tempo.h"
#include "ardour/rc_configuration.h"
using namespace ARDOUR;
using namespace Evoral;
@ -43,7 +45,7 @@ int
ExportSMFWriter::init (std::string const& path, samplepos_t timespan_start)
{
::g_unlink (path.c_str ());
if (SMF::create (path)) {
if (SMF::create (path, 1, Temporal::ticks_per_beat * Config->get_ppqn_factor_for_export ())) {
return -1;
}
_path = path;