Clip emptier

Questions and discussion about building and using Max for Live devices
Post Reply
jbucks
Posts: 5
Joined: Sat Nov 06, 2010 11:36 am

Clip emptier

Post by jbucks » Sun Feb 06, 2011 1:00 pm

Time to build my first Max for Live patch!

I'd like to create a custom button for one of my MIDI controller's pads (an Akai LPD8). This button would clear any MIDI note and clip envelope data within an existing MIDI clip on whatever track is active, but only when that clip has finished playing. In the same way as when you trigger a clip to play, but it doesn't start playing until a point defined by your global quantization settings, I thought to have a 'clip emptier' wait until a MIDI clip has finished playing, and then delete its own MIDI note data.

In other words, if I press a pad on my MIDI controller, then this clip emptier deletes whatever MIDI sequence is inside the active track, but not until the sequencer has finished playing.

Does such a device already exist? And if not, is there a variable within Live accessible by Max for Live to allow this kind of change to a clip to occur, according to global quantization settings? Like some kind of conditional which tests to see if a clip has finished playing?

Any guidelines or advice to help me get started would be really helpful, thanks in advance!

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

Re: Clip emptier

Post by chapelier fou » Sun Feb 06, 2011 2:09 pm

This seems definitely possible.
Check the "clip" and "clip slot" sections in the LOM (in max, click help then m4l), and search for actions about notes. Can't help more for now.
MacBook Pro 13" Retina i7 2.8 GHz OS 10.13, L10.0.1, M4L.
iMac 27" Retina i5 3,2 GHz OS 10.11.3 L10.0.1 M4L.

Surreal
Posts: 560
Joined: Wed May 17, 2006 1:18 am

Re: Clip emptier

Post by Surreal » Sun Feb 06, 2011 3:54 pm

I think it would be as simple as

call select_all_notes
call replace_selected_notes
call notes 0
call done

should be pretty straightforward if you don't need any conditions.

Surreal
Posts: 560
Joined: Wed May 17, 2006 1:18 am

Re: Clip emptier

Post by Surreal » Sun Feb 06, 2011 3:56 pm

HA there are conditions.

i suggest you build the empty logic first.


when you say "not until the sequencer has finished" do you mean the set stopped, or the clip stopped, or the playhead reached the end of the clip?

jbucks
Posts: 5
Joined: Sat Nov 06, 2010 11:36 am

Re: Clip emptier

Post by jbucks » Sun Feb 06, 2011 5:03 pm

Thanks Chapelier Fou and Surreal for your replies! They are already of help!

@Surreal - I imagine that the clip would be emptied when the playhead is at the end of the clip. So let's say I have a 2 bar loop, I would press the 'empty button' for that track while that loop is playing, but then the clip wouldn't empty itself of MIDI notes until the end of that 2 bar loop (or whatever sized clip) has been reached.

Thanks again!

Surreal
Posts: 560
Joined: Wed May 17, 2006 1:18 am

Re: Clip emptier

Post by Surreal » Sun Feb 06, 2011 6:47 pm

I would suggest trigger on stop. an empty clip wouldn't make any sound anyway. following the playhead is pretty unreliable. Try it, maybe it will work for you, but you cannot guarantee that the playhead will hit the end of the clip, ever.

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

Re: Clip emptier

Post by 11olsen » Thu Feb 10, 2011 11:09 pm

you can clear out the notes but i don't think you can change the clip envelopes with a m4l device. someone correct me if i'm wrong.

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

Re: Clip emptier

Post by chapelier fou » Fri Feb 11, 2011 9:12 am

I think you're right.
MacBook Pro 13" Retina i7 2.8 GHz OS 10.13, L10.0.1, M4L.
iMac 27" Retina i5 3,2 GHz OS 10.11.3 L10.0.1 M4L.

jrs1
Posts: 37
Joined: Wed Mar 17, 2010 9:46 pm

Re: Clip emptier

Post by jrs1 » Sun Jun 19, 2011 4:12 pm

I wrote a clip midi clip emptier.

here is the first draft.

BUT - it seems to crash Live when I use it. Though I just made some changes & streamlining, perhaps it won't crash now.



<pre><code>
----------begin_max5_patcher----------
2198.3oc6a00ihiiE84p9UXgVoYWIZV+URf8kU6zyKiz7ztqz9PukPgDSg2J
XGkXJpdFM+2W+EPnqDpj.DPi5VUCI1Ay0Ge8wm60le6wGFsP9FqbD3uA9B3g
G9sGe3AaQlBdve+CiVG+VRVbo8wFkHWulITiF6pSwdSYKGOAHeYLXKC7hPtE
rcEOYEHIimO4+JLETxxXIJPbVFPHUrxwfXQJnfkmEmvrEKWBTqXqAa4pU.3D
.W.j5BJ.akEokSz+KU2FJ1jce2YbAKQtQXM.puvkR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