how to create a new midi-clip via M4L API ???

Learn about building and using Max for Live devices.
Post Reply
loso
Posts: 6
Joined: Mon Oct 23, 2006 5:30 pm

how to create a new midi-clip via M4L API ???

Post by loso » Wed Oct 19, 2011 4:14 pm

Hej Guys

I've got one quick question...
How do I create a new midi clip into an empty clipslot via M4L API?
It must be possible in a way, because the cliip module in liine's griid for iPad does this job.

thanx in advance

Lukas

olivierseb
Posts: 230
Joined: Sun Dec 11, 2005 8:52 pm
Location: FRANCE
Contact:

Re: how to create a new midi-clip via M4L API ???

Post by olivierseb » Thu Oct 20, 2011 8:47 pm

loso wrote:Hej Guys

I've got one quick question...
How do I create a new midi clip into an empty clipslot via M4L API?
It must be possible in a way, because the cliip module in liine's griid for iPad does this job.

thanx in advance

Lukas
Hi Lukas,

AFAIK the API doesn't give us this "power"

really ? griid does this ?

well, until now we couldn't create nor delete a clip unless we hack the keyboard strokes (delete) at the condition you move the focus to the right clip slot.
Maybe griid does this the same way: simulate a double click.

just my 2 cents

olivier
Image

MacBookPro17", mac OS 10.6.2/RME FF400 & FF800
http://www.olivierseb.com

Max for Live training sessions in Paris @
http://www.apaxxdesigns.com/

Max for Live training sessions in Rennes @
http://www.intouchmedia.fr

11olsen
Posts: 157
Joined: Wed Jul 29, 2009 9:12 pm
Location: germany

Re: how to create a new midi-clip via M4L API ???

Post by 11olsen » Tue Oct 25, 2011 11:05 pm

someone with griid running could check what's happening. monitor the griid application/griid control script communication and at least find out if the script is capable of creating/deleting clips. i don't think so, i think it's really done with keypress simulations like said above.

madlab
Posts: 1391
Joined: Fri May 02, 2003 6:38 am
Location: France

Re: how to create a new midi-clip via M4L API ???

Post by madlab » Wed Oct 26, 2011 7:04 am

I think I remember a M4L device on maxforlive.com called 'anomaly performance' (or something of the kind) which held this function... But maybe my memory is wrong.
Aboard from V. 1
MBP M1 Pro 2021 - 16 Go RAM - Monterey 12.6.3
MBP 2.5 Ghz I7 16 Go SSD OSX 10.14
iPad + Mira+ TouchOsc
RME FF UC Live 11.3.21 M4L Max 8
Band : https://elastocat.org/
Madlab sound unit / objects, guitar, electronics / end_of_transmission

11olsen
Posts: 157
Joined: Wed Jul 29, 2009 9:12 pm
Location: germany

Re: how to create a new midi-clip via M4L API ???

Post by 11olsen » Wed Oct 26, 2011 12:10 pm

yep, a good example on how to do it with keypresses. it's actually easy with java but requires users
to have java installed. MXJ can't be freezed into m4l device. and is maybe not completely cross-platform
compatible. and it needs the live window to be active or the keypresses end up somewhere else..

toscanini
Posts: 410
Joined: Thu May 05, 2005 5:42 pm

Re: how to create a new midi-clip via M4L API ???

Post by toscanini » Sat Nov 19, 2011 12:14 am

loso wrote:Hej Guys

I've got one quick question...
How do I create a new midi clip into an empty clipslot via M4L API?
It must be possible in a way, because the cliip module in liine's griid for iPad does this job.

thanx in advance

Lukas
I am missing something or this is actually possible (and simple)
Arm the midi track
Call fire on one of the clip_slots
Call fire again to define the length (probably for a newly recorded clip there is no other way than use multiples of global quantize)
Select_all_notes, replace_selected_notes to populate the clip.

broc
Posts: 1151
Joined: Mon Jul 26, 2004 8:37 am

Re: how to create a new midi-clip via M4L API ???

Post by broc » Sat Nov 19, 2011 1:46 pm

toscanini, the method of 'clip creation by recording' works well in practice and can easily be automated.
For example, this patch creates an empty clip of specified length anywhere in the live set (with global quantize 1 bar).

<pre><code>
----------begin_max5_patcher----------
1025.3oc6YssjZBCF9Z8oHC8xZcHbzs209ZriiSDhZpPBCIZc6N66dII.KtB
Jp.aOrWr3R9C+4Ke4+H773QFKYGvbCvWAOBFM54wiFoFRNvn76GYDiNDDg3p
oYDvhiwTgwDsLA9fPMNOhUNHcWLgFgEpm.lOXRJlm8fHAgQWjhCD5U00Yp4D
fo7h0L4UX1Uv77GZEiJ3jegUJRNoxEfsSTrBEilfDAaHz0UztCzSoS+Gj+Xe
5BTEUUQKITsqXK+wWfyLpfFJJVgFiukRPQFRAuLdr7xj6jAEonfs2BEBsJoP
aXmSg1NtZJzWs.ObSTn+vPgeBrDkxuENTa64Lqg838RhPOMIBm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May 02, 2003 6:38 am
Location: France

Re: how to create a new midi-clip via M4L API ???

Post by madlab » Sat Nov 19, 2011 4:12 pm

@ Broc: I can confirm that works fine, but why is it necessary to wait for a bar before the recording starts ? I thought that should have something to do with the precount but it doesn't seem to be the case (edit : oops, guess that's because of the argument of the timepoint for 'call fire'. If I get it, your patch works only when you start the transport, then it's not possible to add more clips because of the timepoint object. So, to get it work for some supplementary clip creations, we should get the transport position at the timepoint of the new 'call fire', then send it to the new 'call stop' ?
Aboard from V. 1
MBP M1 Pro 2021 - 16 Go RAM - Monterey 12.6.3
MBP 2.5 Ghz I7 16 Go SSD OSX 10.14
iPad + Mira+ TouchOsc
RME FF UC Live 11.3.21 M4L Max 8
Band : https://elastocat.org/
Madlab sound unit / objects, guitar, electronics / end_of_transmission

broc
Posts: 1151
Joined: Mon Jul 26, 2004 8:37 am

Re: how to create a new midi-clip via M4L API ???

Post by broc » Sat Nov 19, 2011 8:21 pm

madlab wrote:@ Broc: I can confirm that works fine, but why is it necessary to wait for a bar before the recording starts ? I thought that should have something to do with the precount but it doesn't seem to be the case (edit : oops, guess that's because of the argument of the timepoint for 'call fire'. If I get it, your patch works only when you start the transport, then it's not possible to add more clips because of the timepoint object. So, to get it work for some supplementary clip creations, we should get the transport position at the timepoint of the new 'call fire', then send it to the new 'call stop' ?
Yes, here is an extended version to create new clips at any time (bar) while playing.

<pre><code>
----------begin_max5_patcher----------
1187.3oc6ZsrbhiCEcM7UnxyxglxR9I8td9MRkhRXKBZhsjKKAS5oq9eerkL
DSvNHvF0oyvhDC5wkiN59TV+X5DmU7WHBGvWAO.lL4GSmLQ0TcCSZ99Dmb7K
IYXgZXNLx+vW82NyzcIIuHUMuhyR4.z91YayorLhTMGTSiq4Lof9uj51ftyc
ecr7sx2N3BrLYCk8zxRRhTCvnfp4.fpoBfHO0i34tfGaliVLxuWPzSvwYV0e
G5llpfZE7+BJvoEnX3b0Lb9VIEmA9KdVpScu+b5z5+MaXTyW.vgSKv9oEXnl
Whf0O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Ikcn.
nGd85h0ZPanooDV6h4xooJeeMf.7Xm6gFio.Svj2GOLAg1GSPSvDzZXpt1Wy
zmdOLkvy3k5I3d301puVWsrqFYjajkfuc2g8MAS1ERdl.IKiIjAXxt9vLwcg
c0kflnKEWMl.6AIjgPxydpRFfnPqtuEZ.hhrJhhLITncCO6+wCRPihN6Y0ny
wlPS10Qomgt.tVDU8keN8+vgjMPC
-----------end_max5_patcher-----------
</code></pre>

madlab
Posts: 1391
Joined: Fri May 02, 2003 6:38 am
Location: France

Re: how to create a new midi-clip via M4L API ???

Post by madlab » Sun Nov 20, 2011 7:30 am

smart way of doing it. I had a look at the LOM and I didn't find any way to observe the position of the transport, just observe the status and toggle...
Aboard from V. 1
MBP M1 Pro 2021 - 16 Go RAM - Monterey 12.6.3
MBP 2.5 Ghz I7 16 Go SSD OSX 10.14
iPad + Mira+ TouchOsc
RME FF UC Live 11.3.21 M4L Max 8
Band : https://elastocat.org/
Madlab sound unit / objects, guitar, electronics / end_of_transmission

broc
Posts: 1151
Joined: Mon Jul 26, 2004 8:37 am

Re: how to create a new midi-clip via M4L API ???

Post by broc » Sun Nov 20, 2011 11:13 am

The transport position can be observed with property 'current_song_time'.

<pre><code>
----------begin_max5_patcher----------
588.3oc0WtsiZCCDF95vSgUj5UkRiCIAn209ZrZUTNLcwUI1Q1NTZWsu60GB
TuTfDXog1K3PlL19e97LShedhmeNaKH7QeB8.xy64IddFSZCdcW64WmssnJS
XbymBemk+M+o1aIgsRi42iv6rQaqYsxJPZF.ty5WYTof7SvXKXVPmYqmxez.
VQ3SnpI7wt61jIKVSnOkxgBo0A7hX0fQg3U5elGNKdJBubVv9wPJMBRIxOfC
7cVcZVsYQ7+LmjUg9BqpzQxD5NEGps8xjI5ul9+BUvCmJqtyP4cnnwJUIRSC
7xk8Ck3wBJEr5ZPI7CoRNjIONVBNOVZ3fPMgYRBi5D7IZOPQ1PGa4fSneLbs
zLjPaA1wFiyJ4te4fwkWCFw2RLlwukTDmbwTL7sSwEiEEOQE5GGsJTaaqAUg
FMZssZqygSjEEdE.XpNqj9j+Qy.bfggAIlVVQACJUqqoebvoFS+oZgiVp1ch
pwIWLVW71w576bEbEYCLSEaqQ5+kJfS7rk4WH40X274b.LLzVUiMM+V8ms.c
.Ux+BfhkK.9FfiJZ4b0NapfoBHIQolaR9ZuDaWevH6KrjDeNjgupFgcFEYaf
xT0znV6zLojSxak1S.3smbd9oM.WPDRfV.6ItE46.uQZJ9QO77Cl3Sa+06FB
VKuXGQ5hCzuCvRPHIz80TOr+0xb7YMorDntOMulT1vTsC5j.5wilYLTEoRFQ
3dTD9U972VQCgQQiJiVM.EENpJJZ.JZ0npH84N6URyGUIEO.EcfruLIot3kI
+BvsJxbC
-----------end_max5_patcher-----------
</code></pre>

Post Reply