View Issue Details

IDProjectCategoryView StatusLast Update
0002454ardourfeaturespublic2012-01-10 17:59
Reportercolinf Assigned Topaul  
PrioritynormalSeverityminorReproducibilityhave not tried
Status closedResolutionfixed 
Product VersionSVN/2.0-ongoing 
Summary0002454: Pitch shift could have a 'Preserve Formants' option
DescriptionThe rubberband library has an option to preserve formants when pitch-shifting, but Ardour currently has no means to set it.

I figured it wasn't too difficult to allow this option to be set, which is what the attached patch does.

It's probably not critical for sensible amounts of pitch-shift of "normal" signals, but the difference is just about audible to me when I shift my voice up or down by an octave. It might be useful to somebody, I suppose...
TagsNo tags attached.

Activities

2008-11-20 20:34

 

rb-preserve-formants-4225.patch (2,265 bytes)   
Index: gtk2_ardour/editor_timefx.cc
===================================================================
--- gtk2_ardour/editor_timefx.cc	(revision 4224)
+++ gtk2_ardour/editor_timefx.cc	(working copy)
@@ -71,7 +71,8 @@
 	  quick_button (_("Quick but Ugly")),
 	  antialias_button (_("Skip Anti-aliasing")),
 	  stretch_opts_label (_("Contents:")),
-	  precise_button (_("Strict Linear"))
+	  precise_button (_("Strict Linear")),
+	  preserve_formants_button(_("Preserve Formants"))
 {
 	set_modal (true);
 	set_position (Gtk::WIN_POS_MOUSE);
@@ -111,6 +112,9 @@
 
 		pitch_cent_spinner.set_digits (1);
 
+		upper_button_box.pack_start (preserve_formants_button, false, false);
+
+
 		add_button (_("Shift"), Gtk::RESPONSE_ACCEPT);
 
 		get_vbox()->pack_start (upper_button_box, false, false);
@@ -253,6 +257,7 @@
 	bool peaklock = true;
 	bool longwin = false;
 	bool shortwin = false;
+	bool preserve_formants = false;
 	string txt;
 
 	enum {
@@ -262,6 +267,7 @@
 	} transients = Transients;
 	
 	precise = current_timefx->precise_button.get_active();
+	preserve_formants = current_timefx->preserve_formants_button.get_active();
 	
 	txt = current_timefx->stretch_opts_selector.get_active_text ();
 
@@ -284,10 +290,14 @@
 
 	if (realtime)    options |= RubberBandStretcher::OptionProcessRealTime;
 	if (precise)     options |= RubberBandStretcher::OptionStretchPrecise;
+	if (preserve_formants)	options |= RubberBandStretcher::OptionFormantPreserved;
+
 	if (!peaklock)   options |= RubberBandStretcher::OptionPhaseIndependent;
 	if (longwin)     options |= RubberBandStretcher::OptionWindowLong;
 	if (shortwin)    options |= RubberBandStretcher::OptionWindowShort;
 		
+		
+		
 	switch (transients) {
 	case NoTransients:
 		options |= RubberBandStretcher::OptionTransientsSmooth;
Index: gtk2_ardour/editor.h
===================================================================
--- gtk2_ardour/editor.h	(revision 4224)
+++ gtk2_ardour/editor.h	(working copy)
@@ -2003,6 +2003,7 @@
 	    Gtk::ComboBoxText     stretch_opts_selector;
 	    Gtk::Label            stretch_opts_label;
 	    Gtk::ToggleButton     precise_button;
+	    Gtk::ToggleButton     preserve_formants_button;
 	    Gtk::HBox             opts_box;
 
 	    Gtk::Button*          cancel_button;

paul

2008-11-21 21:51

administrator   ~0005277

patch applied. good work as usual, and thanks, as usual. maybe 2.7.1 ;)

colinf

2012-01-10 17:59

updater   ~0012535

Closing my old issues: this is long since fixed.

Issue History

Date Modified Username Field Change
2008-11-20 20:34 colinf New Issue
2008-11-20 20:34 colinf File Added: rb-preserve-formants-4225.patch
2008-11-21 21:51 paul cost => 0.00
2008-11-21 21:51 paul Status new => resolved
2008-11-21 21:51 paul Resolution open => fixed
2008-11-21 21:51 paul Assigned To => paul
2008-11-21 21:51 paul Note Added: 0005277
2012-01-10 17:59 colinf Note Added: 0012535
2012-01-10 17:59 colinf Status resolved => closed