Some more frame -> sample changes (in scripts)
authorJohannes Mueller <github@johannes-mueller.org>
Sat, 15 Jun 2019 23:30:34 +0000 (01:30 +0200)
committerJohannes Mueller <github@johannes-mueller.org>
Sat, 15 Jun 2019 23:30:34 +0000 (01:30 +0200)
scripts/_dump_midiregion.lua
scripts/_hook_test.lua
scripts/_osc_hook_example.lua
scripts/midi_cc_to_automation.lua
scripts/tomsloop.lua

index 34ee124b14e9307df8fc27c0faf4bffd31ab6176..0c62a56479406c07346cea0d5f1d780c28a06610 100644 (file)
@@ -7,7 +7,7 @@ function factory () return function ()
                if mr:isnil () then goto next end
 
                print (r:name (), "Pos:", r:position (), "Start:", r:start ())
-               local bfc = ARDOUR.BeatsFramesConverter (Session:tempo_map (), r:position ())
+               local bfc = ARDOUR.BeatsSamplesConverter (Session:tempo_map (), r:position ())
                local nl = ARDOUR.LuaAPI.note_list (mr:model ())
                for n in nl:iter () do
                        print (" Note @", bfc:to (n:time ()),
@@ -18,4 +18,3 @@ function factory () return function ()
                ::next::
        end
 end end
-
index fa5a853e3a3debf4baaa12d2cea786f32da457a4..c5b00445ce3eb39346d80c15c7e163ea0d113f82 100644 (file)
@@ -32,8 +32,8 @@ function factory (params)
                        io.output (file)
                        io.write (string.format ("Region: '%s' pos-changed: %s, length-changed: %s\n",
                                obj:name (),
-                               tostring (pch:containsFramePos (ARDOUR.Properties.Start)),
-                               tostring (pch:containsFramePos (ARDOUR.Properties.Length))
+                               tostring (pch:containsSamplePos (ARDOUR.Properties.Start)),
+                               tostring (pch:containsSamplePos (ARDOUR.Properties.Length))
                                ))
                        io.close (file)
                end
index a708631dcefc0e67ecc1de3754e1b3fff033e33f..2ef81cd5bbe0afa6bb39bf5a6915f83323971a9b 100644 (file)
@@ -44,8 +44,8 @@ function factory (params)
                        obj,pch = ...
                        tx:send ("/region_property_changed", "sTTiii",
                                obj:name (),
-                               (pch:containsFramePos (ARDOUR.Properties.Start)),
-                               (pch:containsFramePos (ARDOUR.Properties.Length)),
+                               (pch:containsSamplePos (ARDOUR.Properties.Start)),
+                               (pch:containsSamplePos (ARDOUR.Properties.Length)),
                                obj:position (), obj:start (), obj:length ())
                end
        end
index afe5bdd00a261acbdb983ee1034983b6ce5e397d..9a5780e73de1c8e89ef67da99b19518d289fc1cb 100644 (file)
@@ -95,7 +95,7 @@ function factory () return function ()
 
                -- MIDI events are timestamped in "bar-beat" units, we need to convert those
                -- using the tempo-map, relative to the region-start
-               local bfc = ARDOUR.DoubleBeatsFramesConverter (Session:tempo_map (), r:start ())
+               local bfc = ARDOUR.DoubleBeatsSamplesConverter (Session:tempo_map (), r:start ())
 
                -- iterate over CC-events
                for av in ec:list ():events ():iter () do
index ea06e486e9009d2ecbab9397634362c17678494b..83ed782b7b013c339ace5202fe9045a02dfe91de 100644 (file)
@@ -274,7 +274,7 @@ function factory (params) return function ()
                Session:abort_reversible_command ()
        end
 
-       print ("bounced " .. n_regions_created .. " regions from loop range (" .. loop:length() ..  " frames) to playhead @ frame # " .. playhead)
+       print ("bounced " .. n_regions_created .. " regions from loop range (" .. loop:length() ..  " samples) to playhead @ sample # " .. playhead)
        ::errorout::
 end -- end of anonymous action script function
 end -- end of script factory