Inconsistent Karma looper [external] time length

mistabu's icon

mistabu

10月 14 2024 | 9:34 午前

Im trying to build a 2-track looper using 2 Karma externals (latest version 1.6.1). See attached maxpat.

Most of the times I end up with different loop length on each Karma external even using the same record/play commands to control both Karma externals. Any ideas?

2-Track Karma_Testing.maxpat
Max Patch

Source Audio's icon

Source Audio

10月 14 2024 | 10:04 午前

If you want to trigger both karma~ objects like that,

Audio Interrpt must be on.

mistabu's icon

mistabu

10月 14 2024 | 10:18 午前

I see. What`s the reason?

Even like this, maybe 1 out of 10 times it shows different buffer time on each karma object. What would be the best option to create a 2-track looper in your opinion?

Thanks again source audio!

Source Audio's icon

Source Audio

10月 14 2024 | 11:33 午前

don't use 2 separate objects, but 2 channels.

if you don't have to use karma~ , there are many other options to sync several loopers.

But loopers can be very different, depending on what you want from it.

mistabu's icon

mistabu

10月 14 2024 | 1:21 午後

Ok that could be an option, instead of 2 karma~.

I don`t have to use karma~, any other way around will work too. I just need to record 2 different mono tracks and to be able to clear one of them to re-record it, but also to export it as audio file if needed. Any ideas?

Source Audio's icon

Source Audio

10月 14 2024 | 2:10 午後

If you describe exactly how you need to record and play or store that loop(s),

it will be very easy to put it together.

Important is if they have to be synced, or

only have exactly same length etc etc

you can also use single mono recorder, but switch different buffers .

anything is possible

mistabu's icon

mistabu

10月 14 2024 | 2:35 午後

I`m trying to build a 2-track guitar looper (2 minutes maximum length), where both tracks has the same length, always synced. It must be possible to overdub the tracks, to clear the tracks separately and to be able to export any of them to audio (wav mono files). Well, it`s quite basic, I`m not looking for complex features.

Source Audio's icon

Source Audio

10月 14 2024 | 3:30 午後

that is really not hard,

most work is needed for logic -

record, overdub, start, stop, clear etc buttons

when they are active, which track should play and so on.

the rest under the hood - audio handling is easy part.

It is too late for me now to post a good patch today, but I'll try that tomorrow.

even better if you explain a bit detailed how you want to go about that

buttons per loop.

Source Audio's icon

Source Audio

10月 15 2024 | 8:29 午前

I am waiting for you to post about dealing with 2 loops,

their relation, if they need to run independently,

how to sync them etc etc.

Without that, it makes not much sense to start with developing anything.

mistabu's icon

mistabu

10月 15 2024 | 8:46 午前

The way Karma object works seems quite effective for what I`m looking for.

The idea is to use the same buttons record/start/stop/clear for both tracks, and selecting to which track is recording via tab (1/2).

For clear, this should delete the audio from the selected track (tab 1/2).

For recording, by default it recs over track 1 by pressing rec, then pressing rec again stops initial recording, sets the loop length, starts playback and continue recording in overdub mode. Pressing rec again, starts a new overdub while playback still running all the time. When pressing play it stops recording and continue the playback without overdub recording mode.

If pressing play after starting the initial recording using rec button, it sets the loop length and starts playback, without overdub recording mode. Then if pressing rec while playback is running, starts overdub recording mode over the selected track via tab 1/2.

If pressing rec after stopping the playback, it resets (clear) both tracks and start again the process of initial recording and setting the loop length, like mentioned before. I mean, when the playback is not running, rec will always start the whole process again (clear both tracks, start recording and setting loop length).

Both tracks should have the same length, so initial recording always sets the loop length for both tracks. Tracks need to be synced always, same playback position.

I need also a timer so I can see the loop duration and playback position in real time.

Thanks a lot source audio!!

Source Audio's icon

Source Audio

10月 15 2024 | 9:52 午前

I know how karma~ works, it is more about what you need.

it is not really made to sync 2 instances.

you could resize 2nd buffer to record length of first one

to avoid different recording lengths.

And then use buttons as you like.

mistabu's icon

mistabu

10月 15 2024 | 10:07 午前

Sure, I tried that "you could resize 2nd buffer to record length of first one", but could not make it works properly. Do you think you`ll be able to post a patch with the needs I mentioned before without using karma~?

Source Audio's icon

Source Audio

10月 15 2024 | 12:44 午後

It is not clear to me how track 2 should function.

What if you record track 1, then record into track 2,

and then re record track 1 , setting new loop length?

is track 2 also deleted ?

mistabu's icon

mistabu

10月 15 2024 | 1:09 午後

The loop length only changes when starting recording on any of the tracks (1/2), it does not matter on which one, if the playback is stopped (I called it "initial recording" when starting from stopped playback). When pressing again rec, it sets the loop length, starts playback and overdub recording mode. If pressing play, it starts playback only (no overdub mode).

This initial recording sets the loop length (both tracks are deleted if there was any audio recorded before). I hope it`s more clear now.

So in fact, it does not matter which is the first recorded track, but by default track 1 is selected to start with.

Source Audio's icon

Source Audio

10月 15 2024 | 1:29 午後

I am not sure if you thought all this properly.

How do you want to sync 2 tracks?

should it be possible to stop track 1, but start recording into track 2 at some point ?

what if you want to only switch playback between 2 tracks ?

which one is providing clock ?

what about track 1 plays, but you want it to stop as soon as you start recording track 2 ?

And many other questions.

mistabu's icon

mistabu

10月 15 2024 | 1:48 午後

  • How do you want to sync 2 tracks?

    In fact I was thinking in 2 different ways:

    1. When pressing rec for first time, it starts recording in both tracks (buffers) but only 1 track is receiving audio input (the track selected 1/2), the other track is recording but it does not get any audio, so it keeps empty. When pressing rec again (starts overdub mode) or play (just starts playback without overdub mode), it sets the loop length on both tracks and start synced playback for both tracks. This way both tracks will have the same loop length and synced playback.

    2. Only the selected track is in recording mode, let`s say track 1. When stopping the recording to start playback with or without overdub mode (rec to overdub mode, start to just playback), it copies the buffer size to the other track (same loop length) and starts synced playback on both tracks. This way both playbacks are synced and has the same loop length.

  • should it be possible to stop track 1, but start recording into track 2 at some point ?

Sure, just need to mute track 1 audio output.

  • what if you want to only switch playback between 2 tracks ?

Using mute/unmute on the tracks audio outputs.

  • which one is providing clock ?

The clock is set after the "initial recording". It means the first track recorded when the playback is stopped.

  • what about track 1 plays, but you want it to stop as soon as you start recording track 2 ?

I do not have this option in mind currently. But it could be done using mute track 1 audio output again.

Source Audio's icon

Source Audio

10月 15 2024 | 2:29 午後

Ok, in that case all you need is one karma and synced

whatever kind of recorder - playback.

Karma must be the Master, the other track will run along,

you can record/overdub into it or wipe it.

I tested karma a bit, it is not really reliable.

But here is one patch doing what you want.

Test it, if you can live with something like this,

I could recreate it without karma, using plain max objects

Max Patch
Copy patch and select New From Clipboard in Max.

karma does not reliably update it's state, so sync for track 2

is not allways turned off when it should.

If sync & recording into track 2 is enabled while track 1 is stoped,

it will get nuts.

mistabu's icon

mistabu

10月 15 2024 | 6:06 午後

Understood! Ok thanks source audio. I`ll check it out tomorrow morning

mistabu's icon

mistabu

10月 16 2024 | 8:17 午前

Im testing it right now, but I think that using plain max objects would be better, you`re right.

Source Audio's icon

Source Audio

10月 16 2024 | 8:32 午前

please, don't get me wrong about karma~

it is great looper by itself, only that some functions

don't exactly fit for your concept.

One would have to add so much arround it that it makes more

sense to make all new.

also you don't need main advantage of karma - varispeed overdubbing.

mistabu's icon

mistabu

10月 16 2024 | 2:01 午後

Sure, karma~ is a great tool. But it does not meet my requirements this time. Probably better using max plain objects. Do you need any other info to recreate it?

Source Audio's icon

Source Audio

10月 16 2024 | 2:21 午後

I only need to verify logic with buttons.

I would suggest 4 buttons for main loop

Record, Overdub, Break, Reset.

2nd track will only have Overdub, Mute and Clear.

Record start can be ended with Overdub, Break or Reset.

Track 2 can only run along Track 1.

If Break is set in Track 1, Track 2 will stop.

After Initial recording is done, both buffers get cut to Loop size

and can be exported without further action.

Reset - is general , stops and wipes both tracks and sets buffer 1 to full length.

is that ok for you ?

Source Audio's icon

Source Audio

10月 16 2024 | 2:22 午後

By the way, loop will have overdub latency compensation, and smooth crossfades on recording

start / stop points.

mistabu's icon

mistabu

10月 16 2024 | 3:04 午後

Sure, that`s perfect. When you say "break" do you mean "stop"?

Thanks!!

Source Audio's icon

Source Audio

10月 16 2024 | 3:12 午後

yes, break = stop.

What Is max loop size that you need ?

mistabu's icon

mistabu

10月 16 2024 | 6:17 午後

I think 2 minutes would be enough. What about "play" button?

Source Audio's icon

Source Audio

10月 17 2024 | 5:39 午前

I described the logic allready.

break serves as stop - play.

I am out today, so loop won't be ready before tomorrow some tie.

I want to finish this prototype, then we can see later.

What do you use to trigger functions ? midi ?

are you Max or Live user ?

mistabu's icon

mistabu

10月 17 2024 | 2:24 午後

ah ok understood, break will work for both stop/play. Im a Max user. For triggering I`ll use both, the mouse (maybe keyboard shortcut) but also midi.

Rodrigo's icon

Rodrigo

10月 17 2024 | 2:43 午後

Just chiming in to say that, the devil is always in the details. karma~ does what it does well, but obviously can't do everything, and it's those logic/edge case behaviors that can end up being complicated.

(Doing what you're describing is in the cards for a future version, but not just yet)

mistabu's icon

mistabu

10月 17 2024 | 3:05 午後

Hey Rodrigo, sure, karma~ it`s a great tool. Don`t get me wrong!

It`s just that in our case, trying to synch 2 different karma~ was not the deal. Hopefully in the near future ;)

Source Audio's icon

Source Audio

10月 18 2024 | 11:57 午前

here is a loop that might do what you want.

Mistabu-Loop-1.maxpat
Max Patch


It took a bit of time to think about relation between 2 tracks.

Track 1 is master. It provides clock for both tracks.

Record start can be ended with :

- Record = loop plays

- Overdub = loop plays & overdubs

- Break = loop stops after recording

- While Recording Clear becomes Re-Rec = restart recording from beginning.

- after recording is finished Clear wipes audio and stops overdub.

Long press on Clear button ( > 500ms) resets both Tracks.

One can start Overdub from breaked loop.

Track 2 :

- Record disables feedback, and so replaces audio as long as it runs.

- Overdub retains recorded audio and overdubs

- Mute does not stop, but mutes playback of Track 2

- Clear wipes track 2 and stops Record or Overdub.

Record/Overdub punch In/out crossfade can be adjusted. (5~250 ms, init 25 ms)

When record ends, that length gets crossfaded over beginning, which allows

click- free sustaining sound on record start-end.

playback heads are latency compensated, to make overdubbing precise.

Textbuttons in Max are bullshit, they can not output 0 and 1 when pressed / released.

For that reason one has to add a lot of stuff to make short-long-double clicks possible,

like for that reset button.

When you try to add remote triggering using midi,

let me know what you want to use.

You can't just connect controllers or notes to that buttons.

So much for now, let me know if this is ok for you.

mistabu's icon

mistabu

10月 18 2024 | 12:08 午後

Hey sure this is ok for me. Thanks

mistabu's icon

mistabu

10月 23 2024 | 2:15 午後

One question about latency compensation, by now this is designed to work at 44.100 but if working at 88.2, 96 or 192 which parameters should be changed?

A part from changing buffers sampling rate.

+~ 441 and %~ 441000 to the used sr?

Source Audio's icon

Source Audio

10月 23 2024 | 3:46 午後

Latency compensation should actually be measured to be precise.

I used rough "over the thumb" values for set sr, sig and I/O vector size.

Max has latency detecting patcher somewhere in examples.

When dealing with samples, one has to adjust ALL parts that need to

get values using samples.

here reset count~ to full buffer size.

You can use dspstate~ output and mstosamps~ conversion to automate that.

I would never use sr higher than 44100 for live looping.

Roman Thilenius's icon

Roman Thilenius

10月 23 2024 | 10:28 午後

which parameters should be changed?

in the final version of a patch, never use "41000" for SR or "32" for vectorsize, but always grab such values values as variables from dspstate~. this way you can forget about it, and the patch will work in every situation.

mistabu's icon

mistabu

10月 24 2024 | 8:14 午前

Thanks for the tip Roman ;)