From eb928b05e98260d6e2079b104b75267058633a1d Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 27 Sep 2017 05:03:10 +0200 Subject: More s/frame/sample/ -- Lua Scripts Sadly this breaks existing loaded scripts. C'est la vie. --- scripts/vamp_audio_to_midi.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts/vamp_audio_to_midi.lua') diff --git a/scripts/vamp_audio_to_midi.lua b/scripts/vamp_audio_to_midi.lua index 5792e8f115..7806dda7c6 100644 --- a/scripts/vamp_audio_to_midi.lua +++ b/scripts/vamp_audio_to_midi.lua @@ -15,13 +15,13 @@ The plugin works best at 44.1KHz input sample rate, and is tuned for piano and g function factory () return function () local sel = Editor:get_selection () - local sr = Session:nominal_frame_rate () + local sr = Session:nominal_sample_rate () local tm = Session:tempo_map () local vamp = ARDOUR.LuaAPI.Vamp ("libardourvampplugins:qm-transcription", sr) local midi_region local audio_regions = {} - local start_time = Session:current_end_frame () - local end_time = Session:current_start_frame () + local start_time = Session:current_end_sample () + local end_time = Session:current_start_sample () for r in sel.regions:regionlist ():iter () do if r:to_midiregion():isnil() then local st = r:position() @@ -56,8 +56,8 @@ function factory () return function () local fd = Vamp.RealTime.realTime2Frame (f.duration, sr) local fn = f.values:at (0) - local bs = tm:exact_qn_at_frame (a_off + ft, 0) - local be = tm:exact_qn_at_frame (a_off + ft + fd, 0) + local bs = tm:exact_qn_at_sample (a_off + ft, 0) + local be = tm:exact_qn_at_sample (a_off + ft + fd, 0) local pos = Evoral.Beats (bs - b_off) local len = Evoral.Beats (be - bs) -- cgit v1.2.3