Record & loop fixed-length audio clip after a pre-set time?

Learn about building and using Max for Live devices.
Post Reply
badkop
Posts: 23
Joined: Mon Sep 10, 2007 11:03 pm

Record & loop fixed-length audio clip after a pre-set time?

Post by badkop » Fri Jul 26, 2013 7:29 am

Hi there

I'm trying to do something I think is quite simple but unfortunately I am also quite simple with M4L 8O :

I want to make a device that will record a clip of a pre-determined length and then start looping it indefinitely. I want this to happen at a pre-set time after the whole set starts to play.

It's for a live theatre show and I won't be near the computer when I want to start the recording, so it would be wonderful if the process could be triggered automatically.

Does anyone have any pointers, or better yet has anyone already done this?

All help greatly appreciated!

Best

Paul

S4racen
Posts: 5839
Joined: Fri Aug 24, 2007 4:08 pm
Location: Dunstable
Contact:

Re: Record & loop fixed-length audio clip after a pre-set time?

Post by S4racen » Fri Jul 26, 2013 7:59 am

If you look in the live object model, the message of fire_clip i think has some additional variables that will do this for you...

Cheers
D

chapelier fou
Posts: 6025
Joined: Mon May 15, 2006 12:15 pm

Re: Record & loop fixed-length audio clip after a pre-set time?

Post by chapelier fou » Fri Jul 26, 2013 9:43 am

i guess you mean call_fire.
MacBook Pro 13" Retina i7 2.8 GHz OS 10.13, L10.0.1, M4L.
MacStudio M1Max 32Go OS 12.3.1

S4racen
Posts: 5839
Joined: Fri Aug 24, 2007 4:08 pm
Location: Dunstable
Contact:

Re: Record & loop fixed-length audio clip after a pre-set time?

Post by S4racen » Fri Jul 26, 2013 11:37 am

Ha thats the bad boy.... I should get a tattoo of the live object model so i always have it with me!

Cheers
D

chapelier fou
Posts: 6025
Joined: Mon May 15, 2006 12:15 pm

Re: Record & loop fixed-length audio clip after a pre-set time?

Post by chapelier fou » Fri Jul 26, 2013 1:11 pm

This stuff is so easy to forget...
MacBook Pro 13" Retina i7 2.8 GHz OS 10.13, L10.0.1, M4L.
MacStudio M1Max 32Go OS 12.3.1

badkop
Posts: 23
Joined: Mon Sep 10, 2007 11:03 pm

Re: Record & loop fixed-length audio clip after a pre-set time?

Post by badkop » Fri Jul 26, 2013 1:49 pm

Thanks guys, investigating now!

Paul

badkop
Posts: 23
Joined: Mon Sep 10, 2007 11:03 pm

Re: Record & loop fixed-length audio clip after a pre-set time?

Post by badkop » Sat Jul 27, 2013 2:38 am

I'm about halfway there, I have the clip slot firing on command from a bang or a metro, but struggling to trigger it at 'X' time after the transport starts?
I've added an ObserveTransport but not sure what to do with it?

I'll keep fiddling but just in case you guys can speed me up!

Paul

chapelier fou
Posts: 6025
Joined: Mon May 15, 2006 12:15 pm

Re: Record & loop fixed-length audio clip after a pre-set time?

Post by chapelier fou » Sat Jul 27, 2013 2:47 pm

if you describe what you want i could do it for you.
Just need the infos :
L8 or L9 ?
Which clip to be recorded ? How long ? When ? What is your global quantization setting ?
MacBook Pro 13" Retina i7 2.8 GHz OS 10.13, L10.0.1, M4L.
MacStudio M1Max 32Go OS 12.3.1

badkop
Posts: 23
Joined: Mon Sep 10, 2007 11:03 pm

Re: Record & loop fixed-length audio clip after a pre-set time?

Post by badkop » Mon Jul 29, 2013 2:26 pm

That's an amazing offer Chapelier. I've got it semi-working myself, with the code pasted below; perhaps you could give it a check? (I hope I've pasted it correctly). I'm using Live 9, the global quantisation is 'none' (the loops don't need to synchronise to anything or with each other). I'm not sure which clips or how long yet so ideally I'd love a patch with a presentation mode that allows me to adjust these properties, though I haven't figured out how to do that. The patch below just records on Track 1 clip 1 (or Track 0 clip 0 rather) for 5 bars as a trial run.

If it's too tricky to have a presentation that allows for parameter adjustments I can figure that part out at the end once I know the final details of the live set....

Thanks so much!

Paul

Code: Select all

{
	"boxes" : [ 		{
			"box" : 			{
				"maxclass" : "comment",
				"text" : "SET CLIP LENGTH",
				"numinlets" : 1,
				"fontsize" : 10.0,
				"frgb" : 0.0,
				"numoutlets" : 0,
				"bgcolor" : [ 1.0, 0.912923, 0.115925, 1.0 ],
				"patching_rect" : [ 26.0, 252.0, 150.0, 18.0 ],
				"id" : "obj-50",
				"fontname" : "Arial Bold"
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "comment",
				"text" : "SET TIME (BARS.BEATS.TICKS)",
				"numinlets" : 1,
				"fontsize" : 10.0,
				"frgb" : 0.0,
				"numoutlets" : 0,
				"bgcolor" : [ 1.0, 0.912923, 0.115925, 1.0 ],
				"patching_rect" : [ 512.0, 133.0, 170.0, 18.0 ],
				"id" : "obj-49",
				"fontname" : "Arial Bold"
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "comment",
				"text" : "ARM TRACK",
				"numinlets" : 1,
				"fontsize" : 10.0,
				"frgb" : 0.0,
				"numoutlets" : 0,
				"bgcolor" : [ 1.0, 0.912923, 0.115925, 1.0 ],
				"patching_rect" : [ 632.0, 252.0, 150.0, 18.0 ],
				"id" : "obj-48",
				"fontname" : "Arial Bold"
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "button",
				"numinlets" : 1,
				"outlettype" : [ "bang" ],
				"numoutlets" : 1,
				"patching_rect" : [ 599.0, 244.0, 20.0, 20.0 ],
				"id" : "obj-46"
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "message",
				"text" : "set arm 1",
				"numinlets" : 2,
				"outlettype" : [ "" ],
				"fontsize" : 10.0,
				"numoutlets" : 1,
				"patching_rect" : [ 529.25, 334.0, 54.0, 16.0 ],
				"id" : "obj-45",
				"fontname" : "Arial Bold"
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "newobj",
				"text" : "live.object",
				"numinlets" : 2,
				"outlettype" : [ "" ],
				"fontsize" : 10.0,
				"numoutlets" : 1,
				"patching_rect" : [ 580.0, 375.0, 59.0, 18.0 ],
				"id" : "obj-43",
				"fontname" : "Arial Bold",
				"saved_object_attributes" : 				{
					"_persistence" : 1
				}

			}

		}
, 		{
			"box" : 			{
				"maxclass" : "newobj",
				"text" : "live.path",
				"numinlets" : 1,
				"outlettype" : [ "", "", "" ],
				"fontsize" : 10.0,
				"numoutlets" : 3,
				"patching_rect" : [ 580.0, 334.0, 51.0, 18.0 ],
				"id" : "obj-42",
				"fontname" : "Arial Bold"
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "message",
				"text" : "goto live_set tracks 0",
				"numinlets" : 2,
				"outlettype" : [ "" ],
				"fontsize" : 10.0,
				"numoutlets" : 1,
				"patching_rect" : [ 599.0, 287.0, 112.0, 16.0 ],
				"id" : "obj-38",
				"fontname" : "Arial Bold"
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "message",
				"text" : "5.1.1",
				"numinlets" : 2,
				"outlettype" : [ "" ],
				"fontsize" : 10.0,
				"numoutlets" : 1,
				"patching_rect" : [ 293.0, 222.0, 33.0, 16.0 ],
				"id" : "obj-34",
				"fontname" : "Arial Bold"
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "newobj",
				"text" : "timepoint 2.1.1",
				"numinlets" : 1,
				"outlettype" : [ "bang" ],
				"fontsize" : 10.0,
				"numoutlets" : 1,
				"patching_rect" : [ 412.5, 133.0, 81.0, 18.0 ],
				"id" : "obj-22",
				"fontname" : "Arial Bold"
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "button",
				"numinlets" : 1,
				"outlettype" : [ "bang" ],
				"numoutlets" : 1,
				"patching_rect" : [ 430.0, 200.0, 20.0, 20.0 ],
				"id" : "obj-21"
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "button",
				"numinlets" : 1,
				"outlettype" : [ "bang" ],
				"numoutlets" : 1,
				"patching_rect" : [ 220.0, 179.0, 20.0, 20.0 ],
				"id" : "obj-16"
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "newobj",
				"text" : "delay 4000",
				"numinlets" : 2,
				"outlettype" : [ "bang" ],
				"fontsize" : 10.0,
				"numoutlets" : 1,
				"patching_rect" : [ 179.0, 252.0, 61.0, 18.0 ],
				"id" : "obj-18",
				"fontname" : "Arial Bold"
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "newobj",
				"text" : "M4L.api.ObserveTransport",
				"numinlets" : 1,
				"outlettype" : [ "" ],
				"fontsize" : 10.0,
				"numoutlets" : 1,
				"patching_rect" : [ 640.0, 469.0, 137.0, 18.0 ],
				"id" : "obj-19",
				"fontname" : "Arial Bold"
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "message",
				"text" : "call stop",
				"numinlets" : 2,
				"outlettype" : [ "" ],
				"fontsize" : 10.0,
				"numoutlets" : 1,
				"patching_rect" : [ 93.5, 344.0, 51.0, 16.0 ],
				"id" : "obj-11",
				"fontname" : "Arial Bold"
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "message",
				"text" : "goto live_set tracks 0 clip_slots 0",
				"numinlets" : 2,
				"outlettype" : [ "" ],
				"fontsize" : 10.0,
				"numoutlets" : 1,
				"patching_rect" : [ 293.0, 302.0, 174.0, 16.0 ],
				"id" : "obj-6",
				"fontname" : "Arial Bold"
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "message",
				"text" : "call fire",
				"numinlets" : 2,
				"outlettype" : [ "" ],
				"fontsize" : 10.0,
				"numoutlets" : 1,
				"patching_rect" : [ 186.5, 356.0, 46.0, 16.0 ],
				"id" : "obj-4",
				"fontname" : "Arial Bold"
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "newobj",
				"text" : "live.object",
				"numinlets" : 2,
				"outlettype" : [ "" ],
				"fontsize" : 10.0,
				"numoutlets" : 1,
				"patching_rect" : [ 239.5, 425.0, 59.0, 18.0 ],
				"id" : "obj-2",
				"fontname" : "Arial Bold",
				"saved_object_attributes" : 				{
					"_persistence" : 1
				}

			}

		}
, 		{
			"box" : 			{
				"maxclass" : "newobj",
				"text" : "live.path",
				"numinlets" : 1,
				"outlettype" : [ "", "", "" ],
				"fontsize" : 10.0,
				"numoutlets" : 3,
				"patching_rect" : [ 303.5, 344.0, 51.0, 18.0 ],
				"id" : "obj-1",
				"fontname" : "Arial Bold"
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "comment",
				"text" : "Device vertical limit",
				"numinlets" : 1,
				"fontsize" : 10.0,
				"hidden" : 1,
				"frgb" : 0.0,
				"numoutlets" : 0,
				"patching_rect" : [ 26.0, 232.0, 118.0, 18.0 ],
				"id" : "obj-3",
				"fontname" : "Arial"
			}

		}
, 		{
			"box" : 			{
				"maxclass" : "comment",
				"text" : "Device vertical limit",
				"numinlets" : 1,
				"fontsize" : 10.0,
				"hidden" : 1,
				"frgb" : 0.0,
				"numoutlets" : 0,
				"patching_rect" : [ 0.0, 170.0, 117.0, 18.0 ],
				"id" : "obj-9",
				"fontname" : "Arial"
			}

		}
 ],
	"lines" : [ 		{
			"patchline" : 			{
				"source" : [ "obj-6", 0 ],
				"destination" : [ "obj-1", 0 ],
				"hidden" : 0,
				"disabled" : 0
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-46", 0 ],
				"destination" : [ "obj-45", 0 ],
				"hidden" : 0,
				"disabled" : 0
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-46", 0 ],
				"destination" : [ "obj-38", 0 ],
				"hidden" : 0,
				"disabled" : 0
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-45", 0 ],
				"destination" : [ "obj-43", 0 ],
				"hidden" : 0,
				"disabled" : 0
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-42", 1 ],
				"destination" : [ "obj-43", 1 ],
				"hidden" : 0,
				"disabled" : 0
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-4", 0 ],
				"destination" : [ "obj-2", 0 ],
				"hidden" : 0,
				"disabled" : 0
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-38", 0 ],
				"destination" : [ "obj-42", 0 ],
				"hidden" : 0,
				"disabled" : 0
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-34", 0 ],
				"destination" : [ "obj-18", 1 ],
				"hidden" : 0,
				"disabled" : 0
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-22", 0 ],
				"destination" : [ "obj-46", 0 ],
				"hidden" : 0,
				"disabled" : 0
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-22", 0 ],
				"destination" : [ "obj-21", 0 ],
				"hidden" : 0,
				"disabled" : 0
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-22", 0 ],
				"destination" : [ "obj-16", 0 ],
				"hidden" : 0,
				"disabled" : 0
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-21", 0 ],
				"destination" : [ "obj-6", 0 ],
				"hidden" : 0,
				"disabled" : 0
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-21", 0 ],
				"destination" : [ "obj-4", 0 ],
				"hidden" : 0,
				"disabled" : 0
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-18", 0 ],
				"destination" : [ "obj-4", 0 ],
				"hidden" : 0,
				"disabled" : 0
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-16", 0 ],
				"destination" : [ "obj-6", 0 ],
				"hidden" : 0,
				"disabled" : 0
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-16", 0 ],
				"destination" : [ "obj-18", 0 ],
				"hidden" : 0,
				"disabled" : 0
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-11", 0 ],
				"destination" : [ "obj-2", 0 ],
				"hidden" : 0,
				"disabled" : 0
			}

		}
, 		{
			"patchline" : 			{
				"source" : [ "obj-1", 1 ],
				"destination" : [ "obj-2", 1 ],
				"hidden" : 0,
				"disabled" : 0
			}

		}
 ],
	"appversion" : 	{
		"major" : 6,
		"minor" : 1,
		"revision" : 0,
		"architecture" : "x86"
	}

}

chapelier fou
Posts: 6025
Joined: Mon May 15, 2006 12:15 pm

Re: Record & loop fixed-length audio clip after a pre-set time?

Post by chapelier fou » Mon Jul 29, 2013 5:10 pm

Try this (to post patches, chose 'copy compressed').
Should work only if global quantize is off. The record length is in beats. Currently it triggers record on the first beat of a bar only. Open it in presentation. Tell me if you need to change anything.

<pre><code>
----------begin_max5_patcher----------
1142.3oc0Y10jZpCFG+Z8SACydo0gDdSO20dcup8b2VGmHF0zhAFRvytsS6m
8lW.AcQfcMxw8FEShv+7i+jmmmvuFOxdUxSXls0+X8n0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vcIgtTsQMF73AP8nGO.6Q3CGnFeGeiBWak.N2E
UBbIrIgUUYkO.ZK3gquN3gFQggFhPtA2TBoTmpJ4yd2vponr8SwFKIOKp7TU
r9qE33bbMlwIziIn93wWdqUEG1QVuFSqug6qILYFpqOlE0Kt88ZTiWGpQtgF
CjbNch2rbja9z.IGoWpS8H2xhgRO8hOCmbb66sKvvnG3c1sq9fmfASNmMyaV
OfgasGXe3iLf2PomdYebGL6rbOE5mdFH93zG+i+foGPeBkp7yCy8qdc6Z3nS
OfyacoYcRPnzzCxxj0mRkPDYI98jL4OCln9Igp+oJQM6L7AR43U6MhMJSjWH
WjTXdlNOsmlEXOVdc983+BD1heMM
-----------end_max5_patcher-----------
</code></pre>
MacBook Pro 13" Retina i7 2.8 GHz OS 10.13, L10.0.1, M4L.
MacStudio M1Max 32Go OS 12.3.1

badkop
Posts: 23
Joined: Mon Sep 10, 2007 11:03 pm

Re: Record & loop fixed-length audio clip after a pre-set time?

Post by badkop » Thu Aug 01, 2013 4:15 am

Hi again

Thanks! I couldn't get it working initially, thought it might be because I'm using max 6 instead of 5 but it's working fine now. Perhaps it needs to initialise on first loading or something?

Anyway, I'm playing around with it. I want to add a few things like automatic arming of the track but I managed that in my own patch so should be able to amalgamate the two. There are a few objects / operations in your patch that I don't understand but it's working so I'll keep examining it; a good learning process.

Thanks again!

P

Post Reply