20 #include <gtkmm/stock.h>
48 N_(
"Percussive Onset"),
55 N_(
"Spectral Difference"),
56 N_(
"High-Frequency Content"),
58 N_(
"Phase Deviation"),
59 N_(
"Kullback-Liebler"),
60 N_(
"Modified Kullback-Liebler"),
67 N_(
"Conform regions"),
74 , detection_threshold_adjustment (0.015, 0.0, 0.1, 0.001, 0.1)
75 , detection_threshold_scale (detection_threshold_adjustment)
76 , sensitivity_adjustment (40, 0, 100, 1, 10)
77 , sensitivity_scale (sensitivity_adjustment)
78 , analyze_button (
_(
"Analyze"))
79 , peak_picker_threshold_adjustment (0.3, 0.0, 1.0, 0.01, 0.1)
80 , peak_picker_threshold_scale (peak_picker_threshold_adjustment)
81 , silence_threshold_adjustment (-90.0, -120.0, 0.0, 1, 10)
82 , silence_threshold_scale (silence_threshold_adjustment)
83 , trigger_gap_adjustment (3, 0, 100, 1, 10)
84 , trigger_gap_spinner (trigger_gap_adjustment)
85 , action_button (Stock::APPLY)
104 Table* t = manage (
new Table (7, 3));
105 t->set_spacings (12);
109 t->attach (*manage (
new Label (
_(
"Mode"), 1, 0.5)), 0, 1, n, n + 1, FILL);
113 t->attach (*manage (
new Label (
_(
"Detection function"), 1, 0.5)), 0, 1, n, n + 1, FILL);
117 t->attach (*manage (
new Label (
_(
"Trigger gap"), 1, 0.5)), 0, 1, n, n + 1, FILL);
119 t->attach (*manage (
new Label (
_(
"ms"))), 2, 3, n, n + 1, FILL);
122 t->attach (*manage (
new Label (
_(
"Threshold"), 1, 0.5)), 0, 1, n, n + 1, FILL);
124 t->attach (*manage (
new Label (
_(
"dB"))), 2, 3, n, n + 1, FILL);
127 t->attach (*manage (
new Label (
_(
"Peak threshold"), 1, 0.5)), 0, 1, n, n + 1, FILL);
129 t->attach (*manage (
new Label (
_(
"dB"))), 2, 3, n, n + 1, FILL);
132 t->attach (*manage (
new Label (
_(
"Silence threshold"), 1, 0.5)), 0, 1, n, n + 1, FILL);
134 t->attach (*manage (
new Label (
_(
"dB"))), 2, 3, n, n + 1, FILL);
137 t->attach (*manage (
new Label (
_(
"Sensitivity"), 1, 0.5)), 0, 1, n, n + 1, FILL);
141 t->attach (*manage (
new Label (
_(
"Operation"), 1, 0.5)), 0, 1, n, n + 1, FILL);
148 get_vbox()->set_border_width (6);
149 get_vbox()->set_spacing (6);
150 get_vbox()->pack_start (*t);
238 for (uint32_t i = 0; i < readable->
n_channels(); ++i) {
246 if (t.run (
"", readable.
get(), i, these_results)) {
252 results.insert (results.end(), these_results.begin(), these_results.end());
253 these_results.clear ();
255 t.update_positions (readable.
get(), i, results);
286 for (uint32_t i = 0; i < readable->
n_channels(); ++i) {
296 if (t.run (
"", readable.
get(), i, these_results)) {
302 results.insert (results.end(), these_results.begin(), these_results.end());
303 these_results.clear ();
307 error <<
"Could not load note onset detection plugin" <<
endmsg;
311 if (!results.empty()) {
349 if (regions.empty()) {
360 for (RegionSelection::iterator i = regions.begin(); i != regions.end(); ++i) {
363 features = (*i)->region()->transients();
365 merged_features.insert (merged_features.end(), features.begin(), features.end());
368 merged_features.sort();
369 merged_features.unique();
371 for (RegionSelection::iterator i = regions.begin(); i != regions.end(); ) {
373 RegionSelection::iterator tmp;
399 ArdourDialog::on_hide ();
Gtk::SpinButton trigger_gap_spinner
LIBPBD_API Transmitter fatal
int run_note_onset_analysis(boost::shared_ptr< ARDOUR::Readable > region, ARDOUR::frameoffset_t offset, ARDOUR::AnalysisFeatureList &results)
Gtk::HScale peak_picker_threshold_scale
void begin_reversible_command(std::string cmd_name)
std::vector< std::string > analysis_mode_strings
RegionSelection regions_with_transients
LIBPBD_API Transmitter error
std::ostream & endmsg(std::ostream &ostr)
static const gchar * _onset_function_strings[]
LIBGTKMM2EXT_API void set_popdown_strings(Gtk::ComboBoxText &, const std::vector< std::string > &)
framecnt_t frame_rate() const
virtual uint32_t n_channels() const =0
Gtk::Button action_button
std::list< framepos_t > AnalysisFeatureList
Gtk::Adjustment sensitivity_adjustment
void split_region_at_points(boost::shared_ptr< ARDOUR::Region >, ARDOUR::AnalysisFeatureList &, bool can_ferret, bool select_new=false)
PBD::Signal0< void > EditorFreeze
Gtk::ComboBoxText operation_selector
Gtk::Adjustment trigger_gap_adjustment
shared_ptr< T > static_pointer_cast(shared_ptr< U > const &r)
int run_percussion_onset_analysis(boost::shared_ptr< ARDOUR::Readable > region, ARDOUR::frameoffset_t offset, ARDOUR::AnalysisFeatureList &results)
LIBARDOUR_API PBD::PropertyDescriptor< bool > regions
void snap_regions_to_grid()
Action get_action() const
std::vector< std::string > operation_strings
int get_note_onset_function()
PBD::Signal0< void > EditorThaw
Gtk::Adjustment peak_picker_threshold_adjustment
Gtk::HScale silence_threshold_scale
Selection & get_selection() const
std::vector< std::string > onset_function_strings
Gtk::Adjustment silence_threshold_adjustment
virtual void set_session(ARDOUR::Session *)
void set_session(ARDOUR::Session *)
void commit_reversible_command()
Gtk::ComboBoxText onset_detection_function_selector
void analysis_mode_changed()
Gtk::Adjustment detection_threshold_adjustment
ARDOUR::AnalysisFeatureList current_results
static const gchar * _operation_strings[]
Gtk::HScale sensitivity_scale
ARDOUR::Session * _session
AnalysisMode get_analysis_mode() const
std::string string_compose(const std::string &fmt, const T1 &o1)
Gtk::ComboBoxText analysis_mode_selector
Gtk::Button analyze_button
Gtk::HScale detection_threshold_scale
static const gchar * _analysis_mode_strings[]