Jump to content

Environment Note Off Handling Tutorials


ski

Recommended Posts

Note Off Handling in Logic's Environment

= PART 1 =

It's often desirable to separate note-on events from the note-off events for various kinds of processing in the environment, particularly in the clicks and ports layer, and before the MIDI data enter's Logic's "sequencer input". A very easy way to separate note ons and note offs is to use a Transformer set to Condition Splitter mode. By setting the Transformer parameters just right, note-offs appear at the top output of the Transformer (called the "top cable"), and note-ons appear at the cable directly below it.

 

In this tutorial, "note-off" is defined as a note-on event with a velocity of zero. There is another kind of note-off event, but for now let's stick to this type: note on, velocity = 0

 

Getting the Transformer to perform this bit of trickery can be... tricky! Getting note-ons and note-offs to separate depends on the settings you make for the Velocity field as well as the Operation Type (equal, unequal, inside, outside, etc.). And as you'll see, some settings for these won't work, even though intuitively you'd think they should, as the following list of settings bears out.

 

• Velocity equals 0

WORKS -- note offs appear at the top cable, note ons at the one below

 

• Velocity unequal 0

DOESN'T WORK -- both note ons and note offs appear at the top cable

 

• Velocity less than or equal to 0

WORKS

 

• Velocity greater than or equal to 0

DOESN'T WORK

 

• Velocity inside 127, 1

WORKS

 

• Velocity inside 1, 127

DOESN'T WORK

 

• Velocity outside 1, 127

WORKS

 

• Velocity outside 127, 1

DOESN'T WORK

778706634_Picture10.jpg.75c139de803d4abaffde77a0687e9738.jpg

Edited by ski
Link to comment
Share on other sites

thanks I have experienced some of these problems when trying to do exactly this... I have also noticed that If I try to filter out note offs at the start of a process and then transform them to meta events (for example meta 98) it starts sending meta values for the on state and meta values of zero when there is no data being sent. Why is this? It makes my fader switch like crazy when I want to hold its value until new data comes. I end up having to re-filter the note offs again, but I don't know where they came from if I filtered them at the start of the process.

 

Thanks for the information... really great stuff... when you have time please keep uploading little tidbits of environment info... I love it... thanks again...

 

Curtis

Link to comment
Share on other sites

Hi Curtis,

 

Glad you found this useful!

 

As to the process you're trying to create, I think I know what's going on. I'll bet you're trying to take the output of an instrument's channel strip and process the notes being played from a region. If that's the case, that presents a special situation which I'm going to address in the next part of my tutorial. But please post back and let me know if my hunch is correct (or not).

Link to comment
Share on other sites

What I ran into not long ago, was that I could split note-offs out using the Equals Zero (or other working variants) and still maintain note-off velocity, as shown in my pic.

 

But I can't seem to do any math operations on the note-off velocities subsequent to that, like we can with the note-on velocities. They result in an "OFF" message and no number.

SplitNoteOff.jpg.54c286762fd7fa8943a431d64242d5ff.jpg

Link to comment
Share on other sites

Note Off Handling in Logic's Environment

= PART 2a =

 

In the previous tutorial I showed how to separate note-on and note-off events as they come into Logic from your MIDI controller, and on their way into Logic. As we saw, some of the velocity condition settings for the transformer -- such as trying to detect velocity unequal to 0 -- just won't work. I tend to use the following method, as it's the simplest to program and easy to remember:

 

Velocity equals 0 -- note offs appear at the top cable, note ons at the one below

 

And why would you even want to separate note-on and note-off messages in the first place? There are a myriad of reasons, some of which have very practical applications, others more esoteric. But before we explore the question of why you'd want to do this, let's get some insight into how Logic handles note-off messages in general.

 

We can use the term "MIDI pre-processing" to characterize how we use environment objects to process MIDI data before it enters Logic's sequencer input. With a few exceptions, whatever results you get by mangling MIDI data with your pre-processing schemes can be recorded on a track. One of those exceptions is indeed Note Off messages, and how Logic deals with them is... "interesting", to say the least! First, let's follow the path of MIDI data as it makes its way into Logic's sequencer, and then we'll get some insights into Note On/Off handling in Logic.

 

Tracks as a Virtual MIDI Patchbay

 

When you select a track (i.e., an instrument track) and the red (R)ecord button is illuminated, you are connecting ("patching") MIDI data coming into Logic's Sequencer Input to the instrument's channel strip. If you turn off the (R) button you break that connection; MIDI data is still hitting the Sequencer Input but it's just not going anywhere. In essence, the instruments you've got assigned to tracks in Logic is a virtual MIDI instrument rack, and you "patch" your controller to the desired instrument by selecting the track and illuminating the (R) button. Connection made!

 

Once MIDI hits an instrument, it's not swallowed and used up. In fact, we can tap the MIDI output of the instrument and pass that data on to other environment objects. It can be as simple as a MIDI monitor (just to have a look see at the data) or to another instrument (this is an interesting way to set up layered instruments right in the environment). So, where is this MIDi output of an instrument? Well...

 

If you delve into the Mixer layer of the environment and look at the upper RH corner of an instrument's channel strip, you'll see a small triangle. This is the channel strip's MIDI output! The environment term for this output is "cable", but it's really just a MIDI output and I'll continue to refer to it as such. Now, there are times when you might want to take that output, process the MIDI data, and route it somewhere else. But when it comes to note on and note off data, what appears at that output can be quite befuddling...

 

Try this: create a new Logic song (Explore/Empty Template), create one instrument track, and load up any instrument plugin you like. Then go into the Mixer layer of the environment, create a new monitor, and cable the output of the instrument to the monitor. (Move any objects to the right of that instrument out of the way to give yourself room if need be). Then, play on your keyboard. You'll see that the MIDI output, as shown in the monitor, looks quite normal: note-on and note-off messages appear as you'd expect. Great! Now...

 

Record something on that track. If you're watching the monitor as you play you won't see anything out of the ordinary; your note-on and note-off messages will appear just fine. But now (and this is where it gets good...) clear the monitor by clicking on it and play back what you recorded. You will see all of your note-on messages, but you won't see any note-off messages!

 

So if you play live, you see what you'd expect to see in the monitor. But upon playback? No note-off messages.

 

And wwwwwwwhy is that? :shock: Stay tuned for part 2b of this tutorial to find out! :mrgreen:

1348833743_Picture12.jpg.5617ca07a2c8a557fb1bc347deab0f1c.jpg

Edited by ski
Link to comment
Share on other sites

Fader8, I answered my own question.

 

Your keyboard is outputting "true" note off commands with release velocity. All true note-off messages 0x8n are treated as 0x9n (with velocity of zero) messages via the condition splitter mode of a transformer.

 

Try this:

 

• create two new transformers, and connect them in series to the note-off output of the condition splitter

• set the status in the first transformer to convert notes to controllers

• in the second transformer, set the top to "= controller" and the bottom to "fix" and the second entry of "-----" that appears in the flip menu

• set the 2nd data byte's value to something (i.e. a constant, such as fix:64) and monitor its output using a new monitor.

 

See if that works to let you process the velocity data.

Link to comment
Share on other sites

Fader8, I answered my own question.

 

Your keyboard is outputting "true" note off commands with release velocity.

Yup. Logic wouldn't be showing different note-off velocities otherwise.

 

 

Try this:

 

• create two new transformers, and connect them in series to the note-off output of the condition splitter

• set the status in the first transformer to convert notes to controllers

• in the second transformer, set the top to "= controller" and the bottom to "fix" and the second entry of "-----" that appears in the flip menu

• set the 2nd data byte's value to something (i.e. a constant, such as fix:64) and monitor its output using a new monitor.

 

See if that works to let you process the velocity data.

 

Nope, no luck with that. The first transformer strips the values. My second trans had a Add 10 operation to data byte 2. Like so:

splitnoteskifixnot.jpg.0b96393f15dba18412b5a209550e8da4.jpg

Link to comment
Share on other sites

Note Off Handling in Logic's Environment

= PART 2b =

 

So why is it that when a region plays back notes, and we monitor the MIDI output of the instrument receiving those notes, we see only note-ons and not note-offs?

 

Well, it seems as though Logic doesn't actually record note-off information. When a note-on is received, Logic makes note [ahem] of the time it was received. When the note-off is received, the total elapsed time between note-on and note-off is calculated. And that's what's displayed as "length" in the event list and various other editors. We can't see the note-offs in the event list. We only see "notes", their positions, and their lengths.

 

Seems as though you wouldn't be able to do something nifty, then, like cable the output of one instrument to another in the environment to make a layered sound (see pic). After all, if there are no note-off's being outputted by the first instrument, wouldn't the second instrument's notes hang?

 

The truth of the matter, however, is quite different. You can, in fact, daisy-chain instrument channel strips and when your region plays back you will not experience stuck notes in any of the connected instruments.

 

So is Logic recording the note-offs after all, but for some reason it just won't show them to us in a monitor connected to the output of an instrument? The answer is "I don't know" --- and that's because I don't know how Logic is coded (does anyone? :lol: ). But the good news is this: it actually doesn't matter if we understand fully what's going on under the hood because we can trick Logic into making those note-offs visible!

 

Once again, stay tuned!

1435532504_Picture14.jpg.6a156e108ec739db0f7025ea6d7799b0.jpg

Edited by ski
Link to comment
Share on other sites

Note Off Handling in Logic's Environment

= PART 2c =

 

Here's how we trick Logic into producing note-offs from the output of a channel strip:

 

• Pic #1: create three transformers and connect them in series from the output of the channel strip

• Pic #2: set up the first transformer to convert notes to controllers (CC's)

• Pic #3: set up the second transformer to convert those controllers back into notes

• set up the third transformer as a "condition splitter" to separate out note-on and note-off as detailed in the first part of this tutorial

• finally, connect monitors to the outputs of the condition splitter, as shown

 

Now record a part and play it back. Note off's will appear! So it seems as though this conversion of note data to controller (CC) data and then back again 'forces' Logic to produce note-offs. (As a side note, I'm pretty sure that you can substitute cpressure or even fader events for controller events in the first two transformers, though I haven't tried it myself.)

 

Well, that'll be the end of my note on/note off tutorials for now. Feel free to post questions. And if time permits I'll post back at a later time with some practical applications for all this.

 

Regards to All,

 

-=sKi=-

437841847_Picture17.jpg.3fd6ae4b2ae29280e9db0299171023f2.jpg

483862269_Picture15.jpg.f55511576d398e4a56e2373ac999a1a6.jpg

1165961858_Picture16.jpg.aad288054f1e0a8798c9bbb46ca9bb48.jpg

Link to comment
Share on other sites

I wonder if I have to make your conversion first then filter note offs... this should get rid of them in other categories (fader, cc, cpress... whatever)... when I tried to filter them previously as notes at the start they did not disappear, and came back to haunt me later in the process when I converted to Meta... I will try this out and see if it makes a difference... I wonder why logic is programmed this way... makes no sense to me, but thanks for the round about fix...

 

once again I love the environment tuts... very compelling when work is slow... thanks again...

 

Curtis

Link to comment
Share on other sites

  • 3 weeks later...
  • 5 months later...

Hi, sorry to rise this topic from the dead...

I managed to filter notes off as described in PART 1 and I 'm using this way to trigger stylus RMX pattern (in groove menu mode) but I would like to stop the same pattern releasing the key and just let it play on until I hit another one (at this time when you hit the same key or another one it plays on the current pattern).

 

Thanks for help.

Link to comment
Share on other sites

About how Logic stores notes: The developers intended to try and keep "notes" atomic - that is, make it hard for you to "lose" note ons or offs independently, as in most cases this doesn't make sense, and doesn't result in anything good. A note should, where possible, be a "note" - ie the note on data, and a duration, rather than two unrelated separate MIDI events that give the illusion of being a note.

 

That's why we have to go through hoops to get at note offs alone in the environment (thanks to Ski for the excellent summary).

 

My *guess* would be that notes are indeed stored internally as the note data and duration, rather than storing the note offs as separate events. This means that note offs would be output automatically by the MIDI engine once a playing note has played it's duration, and avoids any specific note-off processing.

 

Now, if may be that the note ons and offs are stored/buffered individually while recording, and then mangled together when the recording ends (ie, working out which offs belong to which ons, and updating the necessary lengths before saving the region proper.

 

We know Logic's sequencer must handle offs because if echoes MIDI live, and therefore has to work with ons and offs individually, as there is no "duration" so to speak in live playing (as you'd only ever know a duration once the note has ended).

 

So - it may be that note offs are not displayed in the monitor object on playback, but they *are* in live playing, because Logic is automatically generating the offs on playback (or MIDI file export etc) and that code is a little different to just passing the MIDI events, and some little buglet means the monitor object doesn't kinda "see" them, even though they *are* being output, as it doesn't think they are *real* note offs.

 

Just some idle conjectamafying which may be entirely pointless. :)

Link to comment
Share on other sites

Hi, sorry to rise this topic from the dead...

I managed to filter notes off as described in PART 1 and I 'm using this way to trigger stylus RMX pattern (in groove menu mode) but I would like to stop the same pattern releasing the key and just let it play on until I hit another one (at this time when you hit the same key or another one it plays on the current pattern).

 

Thanks for help.

 

I think I posted an environment that does this. Gimme a while and I'll get back to you (if I can find it).

Link to comment
Share on other sites

Hi, sorry to rise this topic from the dead...

I managed to filter notes off as described in PART 1 and I 'm using this way to trigger stylus RMX pattern (in groove menu mode) but I would like to stop the same pattern releasing the key and just let it play on until I hit another one (at this time when you hit the same key or another one it plays on the current pattern).

 

Thanks for help.

 

I think I posted an environment that does this. Gimme a while and I'll get back to you (if I can find it).

 

Wow... Ski, would be fantastic !

Thanks for your help, I'm waiting.

Link to comment
Share on other sites

Couldn't find it. So here's a new one.

 

In the attached file:

 

• go to the clicks/ports layer of the Environment and you'll see a macro in there (the one you see in the screenshot below).

• select it and copy (CMD-C)

• close that song

 

• open your song, go to clicks/ports, get rid of the existing stuff between the Physical Input and the Sequencer Input using the delete key, not CMD-X (that will wipe the marco out of the clipboard). Then CMD-V paste the macro in there and cable it as shown below.

Note Toggler V1_0.logic.zip

1887278858_Picture28.jpg.94f76d9992b6310220d033afd2983f55.jpg

Link to comment
Share on other sites

Cool!

 

Meanwhile, I made a new one which works just slightly differently (attached).

 

In the first version (previous page):

 

• note on 1st time = sound (loop)

• note on 2nd time = no action, releasing note stops sound (loop)

 

This might be useful, in that playing the note the second time does nothing until you release it. This lets you "get ready" to stop the sound by playing/holding the key the second time, then releasing it when you're ready. But I wasn't happy with that. So...

 

In the new version:

 

• note on 1st time = sound (loop)

• note on 2nd time = stop sound (loop)

 

So with this version the sound (loop) stops immediately upon pressing the key a second time.

Note Toggler V2.0.logic.zip

Link to comment
Share on other sites

HI Ski, I finally got time to test it...

As expected, the V2 works flawlessly, thank you very much !

I 'm trying one more thing now if you can help me: At this point, playing a single note triggers a stylus pattern and stops it when I hit the second time.

Is it possible now to hit let's say the "C" to trigger one pattern, and hit "D" which would stops "C" and would trigger a different pattern etc ? (it could be a big deal remembering which note to hit to stop the pattern when you're playing live !)

Of course we would have to keep one note let's say "A" to stops all the pattern if needed.

I don't know how to do that and even if it's possible, thank you for your help...

 

Dan

Link to comment
Share on other sites

HI Ski, I finally got time to test it...

As expected, the V2 works flawlessly, thank you very much !

I 'm trying one more thing now if you can help me: At this point, playing a single note triggers a stylus pattern and stops it when I hit the second time.

Is it possible now to hit let's say the "C" to trigger one pattern, and hit "D" which would stops "C" and would trigger a different pattern etc ? (it could be a big deal remembering which note to hit to stop the pattern when you're playing live !)

Of course we would have to keep one note let's say "A" to stops all the pattern if needed.

I don't know how to do that and even if it's possible, thank you for your help...

 

Dan

 

You're welcome!

 

What you want is possible, but potentially a little complicated. I'll have a think about it today and try to come up with the most elegant way to do it. But first I need a little more info...

 

1) what range of keys would you like this to operate over? 1 octave? 2 octaves? More?

 

2) would you be using this exclusively for triggering drum loops from notes, or would there be times when you'd want to use controls like modwheel or pitchbend as the loops are playing?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...