Note delay that doesn't lose length value?

Learn about building and using Max for Live devices.
Post Reply
solconnection
Posts: 76
Joined: Fri Aug 24, 2007 4:14 am

Note delay that doesn't lose length value?

Post by solconnection » Tue Nov 10, 2009 4:33 pm

Does anyone have any ideas on how i might go about modifying the M4L.md.07.DelayNotes.adv (Midi Delay Notes) tutorial so as to preserve the note duration and not having to resort to setting a note length.

the comment in the tutorial before it indicates it may be possible, but difficult

"We're going to start building a MIDI harmonizer, but there's something important we're going to have to look at fixing before we start. Simply put, dealing with note-on and note-off messages becomes a complex problem when you are working with delays. While it's not impossible to manage with Max (very few things are), we'd quickly be creating patches whose complexity are beyond the scope of a beginning tutorial. Instead, we're going to do something clever to keep our patch simple and to manage note-on and note-off messages. We'll modify our patch to filter out any note-off messages using the Max stripnote object, and then use the makenote object to create the note-off messages for us. When we send the makenote object a MIDI note, it outputs a MIDI note-on message paired with a velocity value, and - after a specified amount of time - sends a note-off message for the note played."


i guess i am ready to go beyond the scope of the tutorial :) has anyone already done this code?

i am really loving max so far, its amazing :)
thanks in advance

solconnection
Posts: 76
Joined: Fri Aug 24, 2007 4:14 am

Re: Note delay that doesn't lose length value?

Post by solconnection » Tue Nov 10, 2009 9:58 pm

is there a good place to go to ask (or search for already discussed) max things such as this. Im sure it's all been done before but maybe the max beta forum on here isn't the best place to be asking general max questions.?

hoffman2k
Posts: 14718
Joined: Tue Jun 15, 2004 6:40 pm
Location: Belgium
Contact:

Re: Note delay that doesn't lose length value?

Post by hoffman2k » Tue Nov 10, 2009 10:04 pm

You need the pipe object. Which remembers multiple events.
Simply putting it between the Midiin and midiout is all you need to do. Then you control the delay by sending a value to the pipe object.

Code: Select all

<pre><code>
----------begin_max5_patcher----------
543.3ocuUssiaBCD8Y3qvhmoQbIoYaeqR8unZUjS7jMSqwFgMoIcU92qY.Sn
aHrrZq1W3xbym4L9X+bXPzV8IvDw9J6GrffmCCBHSMFB59OHpfeZmjanvhj3
QXg.4xn3VuG4UJdAPNEfje16PUWfJIXo7RuZTWa8Vy5rVxs6Nfpm1TA6rsnI
6gzEIwrr7O27Z4R545EIrG6xosL1ykPaBQQwrn8RM2U.eLnffkd6O+zxn90p
xAWKTsAT7sRXH5L7ifXC2Zqvs0V35WlNFoiRZ5ZYMn26M6sOr7FKTR4kDeqS
3ToVAJpYaZzainVgVi8bK.GKfB2bow2pjjjEiG.pnjG0qm4FyG5Va2Hd.CMV
TlC5Ja+r+6Cl8unXGQCNQcJzhtVIMa8nXkqTZK2hZ0l90arkRpUO85.pY8lh
Yjn5WMUwLEf0hIXu856BQck.ptWlzL+toZJAPHwBJ6V2WBCu9hddILdlJYE7
amvvKKrvIZyXTAJPm1xaeuVYM3eZkIYd9ZNh6jID2qHUcdZNIq+BozSFHtGH
byGhj9g62pZNB5+aW61S7ta5zoZ5UTeREjsL6ll9lSzP03mkk8gPIknCHuAB
I6sSHztfrGVe8H9oIjQYiz4wFTptquTu79NBYM1+WJxnqq14W3taPXWwl.LV
TQmIMHFGVXo8wb.EBPMTK31lUpci0NHvdbzw0bQT1LQTxGFhRmAhxeGHx8yk
v+hORrg5
-----------end_max5_patcher-----------
</code></pre>

solconnection
Posts: 76
Joined: Fri Aug 24, 2007 4:14 am

Re: Note delay that doesn't lose length value?

Post by solconnection » Tue Nov 10, 2009 11:16 pm

thanks for the reply!!!, and double thanks for the patch :)

i am trying to do this but it's not working:

Code: Select all

  
 pitch  vel
  \    /
   pack
     |  ( delay )
   pipe/
     |
   unpack
   /   \
   flush
   |    |
   noteout
If i send the pitch and vel straight to the flush it works (produces midi out) but it doesn't seem to like being packed/piped/unpacked for some reason.

any ideas?

thanks again!

solconnection
Posts: 76
Joined: Fri Aug 24, 2007 4:14 am

Re: Note delay that doesn't lose length value?

Post by solconnection » Tue Nov 10, 2009 11:33 pm

actually, i just found a very useful patcher that does exactly what i want.

it's hidden away in the help page for pipe

[p DelayAnythingWithAnyLength]

works beautifully on packed midi notes.

Post Reply