A script triggered by a certain marker - Stephan S - 12-26-2022
Hey there, I'd like to automate recalls of mixer scenes with scripts that are triggered by markers.
I have learned that this is the line that has to be executed:
Code: Session:apply_nth_mixer_scene(0)
Where the number 0 is the first mixer scene.
What do I have to do/write if I want scenes nr 1-8 to be triggered by markers 1-8 (or given names like verse/chorus etc.)
RE: A script triggered by a certain marker - johndev - 12-27-2022
Attached is a script that works for me.
A few caveats:
- Requires Mixbus/32C v8.2 or higher. v8.1.378 and lower don't recognise "Temporal" in Lua session scripts so will throw an error and fail.
- Someone with experience in session scripts, timing, etc. might point out better / more efficient ways to do this.
- If a triggering marker is extremely close to other markers (within a sample buffer, e.g. right on top of each other) then it might fail to find that triggering marker, so won't trigger.
It's looking for markers named "MS x" where x is a number between 1 and 8. You can change that naming requirement by altering this line of code:
Code: local MIXER_SCENE_MARKER_PREFIX = "MS "
EDIT: I found that this wasn't working so have attached a replacement. It just replaces this line...
Code: if (pos + n_samples > mpos:samples()) then
...with...
Code: if (pos + n_samples >= mpos:samples()) then
I'm not sure why it used to work but no longer does. It's a different session in a later version of Mixbus. I suspect it was just luck of the draw whether it ever worked before.
RE: A script triggered by a certain marker - Stephan S - 12-27-2022
Fantastic, thanks a lot. I have recording sessions atm but will try asap. I have the M1 version though, its 8.1 something- have to be patient propably.
RE: A script triggered by a certain marker - Dingo - 12-27-2022
(12-27-2022, 06:23 PM)Stephan S Wrote: Fantastic, thanks a lot. I have recording sessions atm but will try asap. I have the M1 version though, its 8.1 something- have to be patient propably.
8.2 is being released ... https://forum.harrisonconsoles.com/thread-11080.html
RE: A script triggered by a certain marker - Stephan S - 12-28-2022
Whow, great- what a timing -))
RE: A script triggered by a certain marker - Stephan S - 12-31-2022
How can I open a stored script, or don't I have to?
Both ways don't seem to work, also when I paste the content into a new script.
When copy/pasted it looks that at least I can run it. When running after having started the song it shows:
Code: LuaException: [string "..."]:39: attempt to perform arithmetic on a nil value (local 'n_samples')
When running before starting the song, nothing happens.
...and:
- What "type" is it? I tried "EditorAction and "Snippet"
- Do I name the marker (and the scene) MS x with a space or without (MSx)?
RE: A script triggered by a certain marker - johndev - 12-31-2022
It's a session script. Add it in Edit > Script Manager > Session Scripts after placing the script in the scripts folder (Ardour manual tells you where that is if Mixbus manual doesn't).
MS x with space. If you don't want a space then change the line I mentioned to say "MS" instead.
RE: A script triggered by a certain marker - Stephan S - 01-01-2023
Ah- at least now something happens. It crashes. With the following log (Mac Arm CPU):
Code: 0 libardour.dylib 0x102ccc48c luabridge::CFunc::CallMember<Temporal::timepos_t (ARDOUR::Locations::*)(Temporal::timepos_t const&, bool), Temporal::timepos_t>::f(lua_State*) + 332
1 libardour.dylib 0x102ccc484 luabridge::CFunc::CallMember<Temporal::timepos_t (ARDOUR::Locations::*)(Temporal::timepos_t const&, bool), Temporal::timepos_t>::f(lua_State*) + 324
2 libardour.dylib 0x10319a4ec luaD_precall + 636
3 libardour.dylib 0x10319ad08 luaV_execute + 428
4 libardour.dylib 0x103194538 f_call(lua_State*, void*) + 100
5 libardour.dylib 0x103194268 luaD_pcall + 96
6 libardour.dylib 0x10319410c lua_pcallk + 264
7 libardour.dylib 0x1031a8cc4 luaB_pcall(lua_State*) + 288
8 libardour.dylib 0x10319a4ec luaD_precall + 636
9 libardour.dylib 0x10319ad08 luaV_execute + 428
10 libardour.dylib 0x103194538 f_call(lua_State*, void*) + 100
11 libardour.dylib 0x103194268 luaD_pcall + 96
12 libardour.dylib 0x10319410c lua_pcallk + 264
13 libardour.dylib 0x102bd0460 luabridge::LuaException::pcall(lua_State*, int, int, int) + 36
14 libardour.dylib 0x10300dd30 ARDOUR::Session::try_run_lua(unsigned int) + 108
15 libardour.dylib 0x10305aea4 ARDOUR::Session::process_with_events(unsigned int) + 1900
16 libardour.dylib 0x103058e38 ARDOUR::Session::process(unsigned int) + 468
17 libardour.dylib 0x102a2ab7c ARDOUR::AudioEngine::process_callback(unsigned int) + 1988
18 libcoreaudio_backend.dylib 0x1089bed5c ARDOUR::CoreAudioBackend::process_callback(unsigned int, unsigned long long) + 988
19 libcoreaudio_backend.dylib 0x1089c966c ARDOUR::CoreAudioPCM::render_callback(unsigned int*, AudioTimeStamp const*, unsigned int, unsigned int, AudioBufferList*) + 448
20 CoreAudio 0x10e3bd4fc 0x10e3b0000 + 54524
21 CoreAudio 0x1b15d0750 HALC_ProxyIOContext::IOWorkLoop() + 6312
22 CoreAudio 0x1b15ce8b0 invocation function for block in HALC_ProxyIOContext::HALC_ProxyIOContext(unsigned int, unsigned int) + 100
23 CoreAudio 0x1b179aab0 HALB_IOThread::Entry(void*) + 88
24 libsystem_pthread.dylib 0x1afa3026c _pthread_start + 148
25 libsystem_pthread.dylib 0x1afa2b08c thread_start + 8
Should I post this in MacOS forum?
RE: A script triggered by a certain marker - Dingo - 01-01-2023
@StephanS - Well it looks like something in your Lua script is causing havoc.
With macOS crash reports, best to copy the entire crash report - add a note at the top as to what was happening prior to the crash and email them to support: mixbus@harrisonconsoles.com.
RE: A script triggered by a certain marker - x42 - 01-01-2023
(01-01-2023, 08:38 AM)Stephan S Wrote: Ah- at least now something happens. It crashes. With the following log (Mac Arm CPU):
Code: 0 libardour.dylib 0x102ccc48c luabridge::CFunc::CallMember<Temporal::timepos_t (ARDOUR::Locations::*)(Temporal::timepos_t const&, bool), Temporal::timepos_t>::f(lua_State*) + 332
1 libardour.dylib 0x102ccc484 luabridge::CFunc::CallMember<Temporal::timepos_t (ARDOUR::Locations::*)(Temporal::timepos_t const&, bool), Temporal::timepos_t>::f(lua_State*) + 324
2 libardour.dylib 0x10319a4ec luaD_precall + 636
3 libardour.dylib 0x10319ad08 luaV_execute + 428
4 libardour.dylib 0x103194538 f_call(lua_State*, void*) + 100
5 libardour.dylib 0x103194268 luaD_pcall + 96
6 libardour.dylib 0x10319410c lua_pcallk + 264
7 libardour.dylib 0x1031a8cc4 luaB_pcall(lua_State*) + 288
8 libardour.dylib 0x10319a4ec luaD_precall + 636
9 libardour.dylib 0x10319ad08 luaV_execute + 428
10 libardour.dylib 0x103194538 f_call(lua_State*, void*) + 100
11 libardour.dylib 0x103194268 luaD_pcall + 96
12 libardour.dylib 0x10319410c lua_pcallk + 264
13 libardour.dylib 0x102bd0460 luabridge::LuaException::pcall(lua_State*, int, int, int) + 36
14 libardour.dylib 0x10300dd30 ARDOUR::Session::try_run_lua(unsigned int) + 108
15 libardour.dylib 0x10305aea4 ARDOUR::Session::process_with_events(unsigned int) + 1900
16 libardour.dylib 0x103058e38 ARDOUR::Session::process(unsigned int) + 468
17 libardour.dylib 0x102a2ab7c ARDOUR::AudioEngine::process_callback(unsigned int) + 1988
18 libcoreaudio_backend.dylib 0x1089bed5c ARDOUR::CoreAudioBackend::process_callback(unsigned int, unsigned long long) + 988
19 libcoreaudio_backend.dylib 0x1089c966c ARDOUR::CoreAudioPCM::render_callback(unsigned int*, AudioTimeStamp const*, unsigned int, unsigned int, AudioBufferList*) + 448
20 CoreAudio 0x10e3bd4fc 0x10e3b0000 + 54524
21 CoreAudio 0x1b15d0750 HALC_ProxyIOContext::IOWorkLoop() + 6312
22 CoreAudio 0x1b15ce8b0 invocation function for block in HALC_ProxyIOContext::HALC_ProxyIOContext(unsigned int, unsigned int) + 100
23 CoreAudio 0x1b179aab0 HALB_IOThread::Entry(void*) + 88
24 libsystem_pthread.dylib 0x1afa3026c _pthread_start + 148
25 libsystem_pthread.dylib 0x1afa2b08c thread_start + 8
Should I post this in MacOS forum?
Are you running Mixbus 8.2? -- The script won't work in older versions.
|