All times are UTC

 
 



Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: send/receive race condition - track dependencies
PostPosted: Sun Aug 27, 2017 4:27 pm 

Joined: Sun Dec 18, 2011 7:17 pm
Posts: 7
Disclaimer: I'm quite new to Max, so apologies if some of this is wrong/presumptuous... :)

In my style I have generally 2-4 bass instruments and a few acid lines, all of which need *usually* follow the same note.

Using a send/receive pair between tracks to effectively have independent 2 MIDI inputs to an instrument would allow you to just punch in a pattern on the track's own MIDI channel, and then use the other channel to transpose this. I tried it, and quickly discovered that it doesn't work properly, because there is a race condition between the two sources of MIDI data -- the data coming via the send/receive arrives late.

I looked for solutions and found that generally they involve putting a reasonably large delay on the direct MIDI data. Too small a delay and it's unreliable, but too large and you introduce noticeable latency.

Aside from a unilateral feature in Live to do this specific thing, I feel like we should be able to solve this directly with M4L if only track dependencies were a thing (not sure how possible this as an automatic feature with Max as the send/receive channel is a dynamic property of the patch), or at least manually specifiable. Effectively you would then be processing MIDI messages within Max in transactions, so two simultaneous notes on the two separate MIDI tracks would arrive together and be processable together.

Does this make sense? Any thoughts?

Thanks all :)

Alex


Top
 Profile  
 
 Post subject: Re: send/receive race condition - track dependencies
PostPosted: Sun Aug 27, 2017 7:19 pm 

Joined: Mon May 15, 2006 12:15 pm
Posts: 4607
Why not use Live's internal routing ?

_________________
MacBook Pro 13" Retina i7 2.8 GHz OS 10.10.5, L9.5.2, M4L.
iMac 27" Retina i5 3,2 GHz OS 10.11.3


Top
 Profile  
 
 Post subject: Re: send/receive race condition - track dependencies
PostPosted: Sun Aug 27, 2017 8:06 pm 

Joined: Sun Dec 18, 2011 7:17 pm
Posts: 7
I didn't think that was possible because it's not just a simple merge of the MIDI events. If I need a Max patch, I need 2 MIDI inputs somehow, and Live only offers one per track.


Top
 Profile  
 
 Post subject: Re: send/receive race condition - track dependencies
PostPosted: Mon Aug 28, 2017 5:02 am 

Joined: Mon May 15, 2006 12:15 pm
Posts: 4607
Not if you route two tracks into one.

_________________
MacBook Pro 13" Retina i7 2.8 GHz OS 10.10.5, L9.5.2, M4L.
iMac 27" Retina i5 3,2 GHz OS 10.11.3


Top
 Profile  
 
 Post subject: Re: send/receive race condition - track dependencies
PostPosted: Mon Aug 28, 2017 9:32 am 

Joined: Mon Jul 26, 2004 8:37 am
Posts: 1139
Notice that M4L instruments can also be used as *multi-instruments* with 16 different MIDI inputs, if MIDI is routed from other tracks on different output channels.


Top
 Profile  
 
 Post subject: Re: send/receive race condition - track dependencies
PostPosted: Mon Aug 28, 2017 10:40 am 

Joined: Sun Dec 18, 2011 7:17 pm
Posts: 7
If I route two tracks into one, can Max process simultaneous MIDI events somehow? Or at least in a guaranteed order? The use case is having two MIDI tracks trigger notes at the exact same sample time for an arpeggiator.

Will have a play regardless. Thanks


Top
 Profile  
 
 Post subject: Re: send/receive race condition - track dependencies
PostPosted: Mon Aug 28, 2017 12:04 pm 

Joined: Mon May 15, 2006 12:15 pm
Posts: 4607
Nothing in the world is simultaneous.
Kidding aside, you should be fine.

_________________
MacBook Pro 13" Retina i7 2.8 GHz OS 10.10.5, L9.5.2, M4L.
iMac 27" Retina i5 3,2 GHz OS 10.11.3


Top
 Profile  
 
 Post subject: Re: send/receive race condition - track dependencies
PostPosted: Mon Aug 28, 2017 12:44 pm 

Joined: Mon Jul 26, 2004 8:37 am
Posts: 1139
You can use [buddy] to ensure that "simultaneous" inputs are processed in a specified order.


Top
 Profile  
 
 Post subject: Re: send/receive race condition - track dependencies
PostPosted: Mon Aug 28, 2017 4:22 pm 

Joined: Sun Dec 18, 2011 7:17 pm
Posts: 7
Thanks for the tips, both.

I tried setting one MIDI track as the input to another, but between the In / Auto / Off options I couldn't get the MIDI data to merge. Am I missing something there? If I set it to In, it uses the other track's MIDI to control the instrument. If I set it to Auto, it uses the data in the track's own sequencer track.

As for 'buddy', it seems like it's not quite suitable because the MIDI data isn't *always* synchronised. Basically what I realised is that I *must* process the "other" track's MIDI signal first, in order to set the transposition value for any MIDI note coming in on the main channel *even if it is scheduled for the exact same sample*.

So it was probably a red herring to talk in terms of transactions/batching, at least for this particular problem. I just always need to process a specific MIDI input *first* in case they are scheduled for the same sample.

Any ideas?

Thanks again! :)


Top
 Profile  
 
 Post subject: Re: send/receive race condition - track dependencies
PostPosted: Mon Aug 28, 2017 5:21 pm 

Joined: Mon Jul 26, 2004 8:37 am
Posts: 1139
Regarding the timing problem, I think you could just delay all main events by 1ms using [pipe] and if needed compensate by setting the track delay to -1ms.


Last edited by broc on Mon Aug 28, 2017 8:39 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: send/receive race condition - track dependencies
PostPosted: Mon Aug 28, 2017 7:43 pm 

Joined: Mon May 15, 2006 12:15 pm
Posts: 4607
alex-weej wrote:
Thanks for the tips, both.

I tried setting one MIDI track as the input to another, but between the In / Auto / Off options I couldn't get the MIDI data to merge. Am I missing something there? If I set it to In, it uses the other track's MIDI to control the instrument. If I set it to Auto, it uses the data in the track's own sequencer track.



Set your "merge" track : monitor to IN, and input source as "no input" (that's the tricky part).
Then create as many MIDI tracks as you need, with this "merge track" selected as output.

_________________
MacBook Pro 13" Retina i7 2.8 GHz OS 10.10.5, L9.5.2, M4L.
iMac 27" Retina i5 3,2 GHz OS 10.11.3


Top
 Profile  
 
 Post subject: Re: send/receive race condition - track dependencies
PostPosted: Mon Aug 28, 2017 8:56 pm 

Joined: Mon Jul 26, 2004 8:37 am
Posts: 1139
chapelier fou wrote:
alex-weej wrote:
Thanks for the tips, both.

I tried setting one MIDI track as the input to another, but between the In / Auto / Off options I couldn't get the MIDI data to merge. Am I missing something there? If I set it to In, it uses the other track's MIDI to control the instrument. If I set it to Auto, it uses the data in the track's own sequencer track.



Set your "merge" track : monitor to IN, and input source as "no input" (that's the tricky part).
Then create as many MIDI tracks as you need, with this "merge track" selected as output.

Correct. Thanks for the clarification. I've deleted the wrong part of my previous post.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 12 posts ] 

All times are UTC

 
 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group