"1 press a button to start recording loop1 in track 1 in sync with the mastertrack (the loop playing on the mastertrack being the quantize unit for track 1)"
Okay, let's go through this without scripts first, just imagine you have a big footswitch with all the buttons you need.
There are three concepts that can control when things happen: Synchronization, Quantization, and Follow. It's confusing because you can combine them, and Follow only applies to MIDI tracks. Let's start with the first two since they apply to both track types.
Synchronization happens when you record a new loop for the first time. Synchronization looks for locations in something outside the loop you are recording.
Quantization happens after the loop has been recorded. Quantization looks for locations inside the loop you are playing.
Synchronization is controlled by the Sync Source parameter, and for most people this is either Host to synchronize with the transport running in the plugin host application, or Track to let tracks synchronize with other tracks. I haven't seen you mention using a host application so I'll assume you are using track sync.
When you use track sync one of the tracks is the track sync master, usually this is the very first track that has been recorded. It can be any of the 8 tracks, but in this example let's assume that Track 1 is the track sync master. The Sync Source for track 1 is either None or Track. When you press Record the recording starts and ends immediately since there are no other tracks to synchronize with.
Now you select track 2 and want to record a loop that is the same size as the loop that is playing in track 1. Track 2 must have the Sync Source parameter set to Track and the Track Sync Unit set to Loop. When you press Record, it will wait until track 1 reaches the end, then the recording starts. At some point before track 1 reaches the end, press Record again. The recording will keep going until track 1 reaches the end, then recording stops. The result is that the loop in track 2 is now exactly the same size as the loop in track 1 and they are aligned. Being aligned means they start and end at the same time.
Now we want to record a second loop in track 2 that is the same size as the other loops that are playing. This is where it starts to get more complicated. Changing loops in a track is called loop switch. When you use the NextLoop function, Mobius will stop playing loop 1 and move to loop 2. By default, this will happen immediately. If you press NextLoop when you are in the middle of loop 1, the sound from loop 1 will be immediately cut off, and loop 2 becomes the selected loop. Since loop 2 is empty, track 2 will not be playing anything, only track 1 is playing. When you change loops you usually do not want that to happen immediately. It is more common to want to wait until the loop that is currently playing reaches the end, then change the loop. To do that, we can use Quantization. We want to wait for a location inside the loop that is currently playing.
Quantization for the functions that change loops is controlled by the parameter named Switch Quantize. This is most often set to Loop. This means that whenever you select a loop, you will always allow the current loop to play until the end before moving to the next loop. Note that this is not synchronization. It does not matter what the master track 1 is doing, we are working entirely inside track 2 and letting track 2 loop 1 decide when to make the switch. Because of the way track 2 was recorded, the loop switch will happen when the loop in master track also reaches the end, but that is just coincidence because track 1 and track 2 are the same size.
To record track 2 loop 2, we can use track sync just like we used when recording track 2 loop 1. After the switch, if you press Record, it will wait until the master track 1 reaches the end, then begin recording. Press Record again and it waits until the master track reaches the end to end the recording. Track 2 loop 2 will now be exactly the same size as track 1 loop 1 and track 2 loop 1. Because track sync was used track 1 and track 2 are aligned.
But let's back up and say that when you switch from loop 1 to loop 2 in track 2, you don't want to wait to start recording, you want the recording to begin immediately after the switch to loop 2. There are two ways to do that, and this is where it starts becoming very complicated.
- "Stacking" a Record action on the Switch event
- Use the Empty Loop Action parameter
When you use the Switch Quantize parameter to delay changing loops until the current loop reaches the end,
Mobius creates an event. An event is something that is placed inside a loop at a particular location. When the loop playback position reaches the location of the event, the event is executed. In the UI, you will see events in the loop meter in the center of the window. They appear as a little arrow with white text underneath the loop meter bar. This is how all quantization is done. Quantization schedules events in the loop to perform actions at a specific time.
Once you have an event in the loop timeline, you can continue pressing buttons and scheduling more events. New events can either be "pushed" to the next quantization point after the last event, or they can be "stacked" under the last event so that both events happen at the same time. When events are pushed, you will see multiple arrows at different times, when events are stacked, you will see one arrow with several lines of text underneath.
The rules for whether events are pushed or stacked are complex and I won't go into all the details here. But the most important rule is that when you have a Switch event scheduled, all future events are stacked under the Switch event.
What this allows you to do is start a quantized loop switch, and then stack any number of actions to happen immediately after the switch takes place. The most common action to stack is Record, which means that recording of the next loop will happen immediately after the switch.
The other way to start recording immediately after a switch is using Empty Loop Action. One of the values for this parameter is Record. This means that whenever you use NextLoop to switch to a loop that is empty, recording will start immediately and automatically. The end result is the same as stacking a Record after the Switch, but you don't have to press two buttons. You only have to press NextLoop.
The difference between using Empty Loop Action and stacking a Record is that when you stack a Record, the Record always happens after the switch, even if the next loop is not empty. The current contents of the loop will be thrown away, and a new loop is recorded. Recording with Empty Loop Action happens only when the next loop is empty. If the next loop is not empty, you simply start playing the next loop.
This post has gotten pretty long and dense, so I'll stop here and continue in another.