update note tail velocity with a message?

Discussions, advice, bug reports and much more about the "bach" environment.
Post Reply
einbahnstrasse
Posts: 16
Joined: Wed Jul 17, 2013 5:42 pm

update note tail velocity with a message?

Post by einbahnstrasse » Wed Jun 28, 2017 10:09 pm

Hi All —

I've been moving away from the use of amplitude slots and into midi velocity curves using breakpoints (for use with a polysynth), and I'm having trouble with one recurring issue. The normal breakpoint syntax works for me except in the case of a note's tail. In this example (patch below), I'd like to add a simple triangular dynamic curve (fade in / fade out) using just a couple of breakpoints and using the note's tail as a terminal point of minimal velocity. The final addbreakpoint message (in red) seems to have no effect on the note's tail, whose velocity remains at 100, despite that before any breakpoints were added I'd sent the note a "velocity = 1" message (blue). Ideally this should set the entire duration of the note to velocity = 1, but notice how the tail remains unaffected.

The only solution I've found so far as been to manually update all note tail velocities by navigating to each one in the bach inspector. This is fairly cumbersome. Am I missing something essential here? Please let me know if anyone's found another solution.

Many thanks! —
Louis~

<pre><code>
----------begin_max5_patcher----------
1970.3oc6bssbihCD84juBJ+vVyVUVW5BW2ZmG1uio1JkLHGqIXDEHhi2o1+
8URfvBaQhcRrmLILWLXARc2Gc5Vs.I+iquZ1B9iz5Yd+o227t5peb8UWoKRU
vUce+pYqIOllSp021rT950zBwraZulf9nPW9e4Q7p2tdAOmk5QerrhVWy3Ed
7kdhUrZuZdkvaCuIOyaA0qfkRMMQQyZdiHmJzB.zUZIQjthUb2sUzTQqBhg9
yChf9P3MxySlCtwCE4qO.lC79mtZxxzJDew2+CH1RHrBiLfcEVK1lS027LUA
+20Wq93lWMRjJwf689MuBtfJsdhP9g7DBK2qhtlvJp8jk8.MmmxDaUPDD.NY
3.k.lGEGDABuwyuEFheZz.dFQChPT0vbaDvwMhXjRigfX8gvHs9irzeU6pEP
8J9FCjM6PiC4aJrUvhskzVQLaVeicFr6EMBAu3jsaTHrmK6qw.ju4SW8cIiZ
cKHE2cVsvB5FoFb.MegWfaqN33r5XfxdCifykbXXT7d86V1N9os8adlimSrY
sLJG4N5AfSMMWZ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ts: 1347
Joined: Fri Dec 03, 2010 1:25 pm

Re: update note tail velocity with a message?

Post by danieleghisi » Wed Jun 28, 2017 10:47 pm

Hi,

you should not be allowed to add breakpoints at position = 0 or position = 1. Those are always already there.
What you should actually be allowed to do is some sort of: [sel tail] message.

You do have however a "sel breakpoint" message.
For the time being, this should be a workaround --- can you confirm this works for you?

Thanks for pointing this out.
d

<pre><code>
----------begin_max5_patcher----------
1773.3oc6as0ahiCE941eEQ7vpYkXQ1N2WsyC6uiQqpLIFhmZriRbJkcz7ee
scR.GvTfNTlYaSuPR7sy47ct3iI1e696lLW7Lodh2e58Eu6t6a2e2clhzEbW
2y2MYE94LFt1zrIYhUqHb4jos0IIOKMk+WdYLZ1id+lGWHIdxBrT8g5FLk4U
QVgo7ZOUYOQXhLpbimXgGD.5GGdyJJmQjFh.6JjlaFZw7u9GPXeKqkaXDS48
kThkYET9xGpHYxVYAkBlEmDFChl5EDLCL0CkzdALC38O6HpnQ1SUftvue+85
OldlnAVJqZn8LR6fI2TRZ4hISrI0KJenfiKeZhXJntPrtG+dAgOAokTHHwbI
J1H2niJ2vWgbOuQJE7iJ2yw7kmurmdYp1H3rvXX.DpTsFIEEz+4UTB4j0Jd6
.y74dgurTO8DWOaTw+UiJI.MdDECmo7.fwIun1O7UfMqH003kjC.mFdMg4gY
rod5alWQvOVJnboGcgGkmSd16yeVIq6BBXdZa25GvEBtjiW0Jz+cEEytTOLj
COLzEAnQgPi6CLRewGgNkWjEuWS+Wy3CUM+JBuaAWbdtE1BlEp9W+WD3sEAu
rXvAJOx9XvcvHLI91AiWuXyfyH17NERcA9IxYDlNxD1p0YE5G7FDk9jFR+L7
CCuHinXkaHBFfRCTfTmKYX5qzHpq3kU3bpNGFqlNeYlfIpZIJXlOLNJHdp5t
nvfT.ReWptHELAsnaW2P88Sk2ALMR2ZePZBHn8NUQGzuETFyz2G5Qwc7kiFY
9Dd4r2divODiN.gdMCfZ9uVMNJFrUaX2fxJQonRRUoVnSHalepqQoQJrUg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wbf8cmCrO3CMxXSpUqTCQ8gatQgjXe0
pKEhp7A2X+JCZeqP8WOJN5XSqciHn+slfA2ZBFdKIn8tqSzTt26RcEt5QR09
ERyoYEXNWuatOv51ZOJ2uqa2UauE8g07oK4cb8oK3URFABBgIAmeGBii7C0c
.BrdkZCutcSLu+VQNSzvka2.4Vms.SOlXsQn6OpAlcStt7gG3fZQSUV+VDu6
ju3say1mqTtTNt+vN7ksazcq1TPyyIb6MisRy0tgq6NdLQfYw8GOlDy4hI1e
VX2C6nEsFOmQxO9wk3bkAyxPuxBQjRHzrbHvh+CAuM7O75y+A9AyP8GzsahP
.tBBw0iczq+FdBtAcaYGzoXGzMkc7OA6Ddy3lzyvxw+lwMlufh2JC41303xx
tS7hgWzbhZNwu1dZnLGtIk6Lu8QygWRMq6tyti47KplQLqPkfWlrop8Ta8bT
6w0exJQNoh2P6NglJJ+86+OvOODmU
-----------end_max5_patcher-----------
</code></pre>

einbahnstrasse
Posts: 16
Joined: Wed Jul 17, 2013 5:42 pm

Re: update note tail velocity with a message?

Post by einbahnstrasse » Thu Jun 29, 2017 1:29 am

Thank you Daniele! As usual, that did the trick. :)

I don't see anything in the documentation for breakpoint index, esp. as a conditional selection as you've got in your patch. This is extremely helpful to know about... Did I overlook this issue regarding breakpoint indices? I don't see this discussed in a quick search for breakpoint+index.

I'd like to be sure I understand how these work. If the tail = breakpoint index of 1, then does that mean the others are indexed by their relative duration as well? I also tried this: (1) created the breakpoint at 0.5 with velocity = 60 as the message box indicates, and then send a message of [sel breakpoint if index == 0.5] ...to no avail. It would seem that they aren't numbered by relative duration, but if not, how are they? If I'd like to be able to select the other breakpoints conditionally, how would this work?

Thank you! —

danieleghisi
Site Admin
Posts: 1347
Joined: Fri Dec 03, 2010 1:25 pm

Re: update note tail velocity with a message?

Post by danieleghisi » Thu Jun 29, 2017 11:43 pm

Indeed, you do have "index", "noteindex", "chordindex" variables — whenever meaningful.
I thought that was documented, but most likely you're right — i'll check this.

Index is actually an increasing cardinal number: first breakpoint is 1, second is 2, and so on. Actually it's the index of the elements you are selecting: if you're selecting notes, those are note index, if you're selecting chords or markers, those are chord/marker index, and so on.

What I did is to select the first breakpoint of a note with no breakpoints: this is the note tail. (If you had a middle breakpoint, that would be the middle breakpoint, and the tail would have index 2). Then modify the tail velocity. Now you're done, since you can add whatever breakpoint you wish in the middle: the issue was mostly with the tail. (I did change the tail as very first thing, since it'd be harder to do it later: suppose you have already a lot of breakpoints, you should select the tails by writing "sel breakpoint if index == N", but you don't really know what N is. In perspective, you might have something like "sel breakpoints == numbreakpoints", that'd make more sense.)

Hope this helps!
d

einbahnstrasse
Posts: 16
Joined: Wed Jul 17, 2013 5:42 pm

Re: update note tail velocity with a message?

Post by einbahnstrasse » Thu Jun 29, 2017 11:50 pm

Ah yes, that definitely helps... Sorry, I didn't realize "index" could be invoked for virtually any item like this. Moreover, thanks for clarifying that a note without any other breakpoints includes the tail as breakpoint #1.

Cheers! —

Post Reply