File: fix-cli-audio.diff

package info (click to toggle)
musescore3 3.2.3%2Bdfsg2-19
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 218,192 kB
  • sloc: cpp: 291,369; xml: 200,226; sh: 3,779; ansic: 1,447; python: 393; makefile: 249; perl: 82; pascal: 79
file content (67 lines) | stat: -rw-r--r-- 2,251 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Description: Fix single-note dynamics on rendering scores via a command line
Origin: upstream, commit:2b1377813e61cc5b8d7bf8574e38f45f1f59526d
Author: Dmitri Ovodok <dmitrio95@yandex.ru>
Forwarded: inquiry via IRC

--- a/mscore/exportaudio.cpp
+++ b/mscore/exportaudio.cpp
@@ -52,11 +52,6 @@ bool MuseScore::saveAudio(Score* score,
         return false;
     }
 
-    EventMap events;
-    score->renderMidi(&events, synthesizerState());
-    if(events.size() == 0)
-          return false;
-
     MasterSynthesizer* synth = synthesizerFactory();
     synth->init();
     int sampleRate = preferences.getInt(PREF_EXPORT_AUDIO_SAMPLERATE);
@@ -72,6 +67,16 @@ bool MuseScore::saveAudio(Score* score,
                 synth->init();
           }
 
+    EventMap events;
+
+    score->masterScore()->rebuildAndUpdateExpressive(synth->synthesizer("Fluid"));
+    score->renderMidi(&events, score->synthesizerState());
+    if (synti)
+          score->masterScore()->rebuildAndUpdateExpressive(synti->synthesizer("Fluid"));
+
+    if (events.empty())
+          return false;
+
     int oldSampleRate  = MScore::sampleRate;
     MScore::sampleRate = sampleRate;
 
--- a/mscore/musescore.cpp
+++ b/mscore/musescore.cpp
@@ -6823,11 +6823,6 @@ bool MuseScore::saveMp3(Score* score, QI
       Q_UNUSED(wasCanceled);
       return false;
 #else
-      EventMap events;
-      score->renderMidi(&events, synthesizerState());
-      if(events.size() == 0)
-            return false;
-
       MP3Exporter exporter;
       if (!exporter.loadLibrary(MP3Exporter::AskUser::MAYBE)) {
             QSettings set;
@@ -6898,6 +6893,16 @@ bool MuseScore::saveMp3(Score* score, QI
 
       MScore::sampleRate = sampleRate;
 
+      EventMap events;
+
+      score->masterScore()->rebuildAndUpdateExpressive(synth->synthesizer("Fluid"));
+      score->renderMidi(&events, score->synthesizerState());
+      if (synti)
+            score->masterScore()->rebuildAndUpdateExpressive(synti->synthesizer("Fluid"));
+
+      if (events.empty())
+            return false;
+
       QProgressDialog progress(this);
       progress.setWindowFlags(Qt::WindowFlags(Qt::Dialog | Qt::FramelessWindowHint | Qt::WindowTitleHint));
       progress.setWindowModality(Qt::ApplicationModal);