summaryrefslogtreecommitdiff
path: root/muse2/muse
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-12-25 20:22:02 +0000
committerFlorian Jung <flo@windfisch.org>2011-12-25 20:22:02 +0000
commit76db51dade62c59e2673da986ab215acc41fd05c (patch)
tree8635c06720657d90c6a7db3eb920cbb103727fe7 /muse2/muse
parent6d181986beeacc4508aa6c3df71b8b56f6acfd0a (diff)
(for the quick glance: "the quantize-fix")
qu4n71z3 n0w r0und5 up wh3n 1t h4s t0 d3c1d3 wh37h3r t0 l3ng7h3n 0r sh0r73n a n0t3 by 7h3 s4m3 l3ng7h. 7h47 15, wh3n qu4n71z1ng f0r f0ur7hs, 4n 31g7h 15 n0t 4ny m0r3 qu4n71z3d t0 a v3ry sh0r7 n073, bu7 t0 a f0ur7h. btw, 7h15 c0mm17 15 v3rrrry 31337 :D
Diffstat (limited to 'muse2/muse')
-rw-r--r--muse2/muse/functions.cpp16
-rw-r--r--muse2/muse/midiedit/scoreedit.cpp2
2 files changed, 9 insertions, 9 deletions
diff --git a/muse2/muse/functions.cpp b/muse2/muse/functions.cpp
index 77825f52..71621b0d 100644
--- a/muse2/muse/functions.cpp
+++ b/muse2/muse/functions.cpp
@@ -177,7 +177,7 @@ bool quantize_notes(const set<Part*>& parts)
{
if (!MusEGui::quantize_dialog->exec())
return false;
-// (1<<MusEGui::quantize_dialog->raster_power2)
+
int raster = MusEGui::rasterVals[MusEGui::quantize_dialog->raster_index];
quantize_notes(parts, MusEGui::quantize_dialog->range, (MusEGlobal::config.division*4)/raster,
MusEGui::quantize_dialog->quant_len, MusEGui::quantize_dialog->strength, MusEGui::quantize_dialog->swing,
@@ -568,16 +568,16 @@ unsigned quantize_tick(unsigned tick, unsigned raster, int swing)
int tick_dest2 = tick_dest1 + raster + raster*swing/100;
int tick_dest3 = tick_dest1 + raster*2;
- int tick_diff1 = tick_dest1 - tick;
- int tick_diff2 = tick_dest2 - tick;
- int tick_diff3 = tick_dest3 - tick;
+ int tick_diff1 = abs(tick_dest1 - (int)tick);
+ int tick_diff2 = abs(tick_dest2 - (int)tick);
+ int tick_diff3 = abs(tick_dest3 - (int)tick);
- if ((abs(tick_diff1) <= abs(tick_diff2)) && (abs(tick_diff1) <= abs(tick_diff3))) //tick_dest1 is the nearest tick
- return tick_dest1;
- else if ((abs(tick_diff2) <= abs(tick_diff1)) && (abs(tick_diff2) <= abs(tick_diff3))) //tick_dest2 is the nearest tick
+ if ((tick_diff3 <= tick_diff1) && (tick_diff3 <= tick_diff2)) //tick_dest3 is the nearest tick
+ return tick_dest3;
+ else if ((tick_diff2 <= tick_diff1) && (tick_diff2 <= tick_diff3)) //tick_dest2 is the nearest tick
return tick_dest2;
else
- return tick_dest3;
+ return tick_dest1;
}
bool quantize_notes(const set<Part*>& parts, int range, int raster, bool quant_len, int strength, int swing, int threshold)
diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp
index f17ea6f8..9c3668e6 100644
--- a/muse2/muse/midiedit/scoreedit.cpp
+++ b/muse2/muse/midiedit/scoreedit.cpp
@@ -4663,7 +4663,7 @@ void ScoreCanvas::add_new_parts(const std::map< MusECore::Part*, std::set<MusECo
* ? support and correctly map e-note on record and steprec
* ? only record nonmuted/whatever notes
* ? support drum controllers
- * o refuse to mix up old-style and new-style drum tracks in ONE editor
+ * x refuse to mix up old-style and new-style drum tracks in ONE editor
* o drummap saving and loading (per-track)
* o drummap import/export
* o drummap automatically adapting to the chosen midi synth / patch