Old 07-10-2018, 09:50 AM   #1
DarkStar
Human being with feelings
 
DarkStar's Avatar
 
Join Date: May 2006
Location: Surrey, UK
Posts: 19,677
Default Q: mpos in midirecv?

The standard format of a midrecv() is:
Code:
midirecv(mpos, msg1, msg23)
For years I have understood that mpos reflects the position of the message within a bock. So I can use it as an index into the block.

But, wait a moment have a look at this - two chords, the first with all notes starting at the same time, the second with them slightly staggered.



When monitored using midi_logger_DS the first 3 Note Ons have the same Offset number and the first 3 Note Offs have the same Offset. How is that possible? Or, what am I misunderstanding?
__________________
DarkStar ... interesting, if true. . . . Inspired by ...
DarkStar is online now   Reply With Quote
Old 07-10-2018, 07:31 PM   #2
Time Waster
Human being with feelings
 
Time Waster's Avatar
 
Join Date: Aug 2013
Location: Bowral, Australia
Posts: 1,638
Default

This is what I would expect. The offset is basically the sample number, within the block, that the message was received in. As a sample covers a finite length of time, it is quite possible for all three note-ons etc. to be received at the same offset.
__________________
Mal, aka The Wasters of Time
Mal's JSFX: ReaRack2 Modular Synth
Time Waster is offline   Reply With Quote
Old 07-11-2018, 03:16 AM   #3
DarkStar
Human being with feelings
 
DarkStar's Avatar
 
Join Date: May 2006
Location: Surrey, UK
Posts: 19,677
Default

Hmm, I'm still missing something.

Here, my buffer size is 256. From that I understand that means that a block has 256 slots. And, in a JS FX, each slot can hold 1 MIDI message - is that where I have gone wrong?

If so, then how many MIDI messages can I have in a block (and therefore process in an @block section)?
__________________
DarkStar ... interesting, if true. . . . Inspired by ...

Last edited by DarkStar; 07-11-2018 at 04:10 AM.
DarkStar is online now   Reply With Quote
Old 07-11-2018, 04:05 AM   #4
Time Waster
Human being with feelings
 
Time Waster's Avatar
 
Join Date: Aug 2013
Location: Bowral, Australia
Posts: 1,638
Default

The number of MIDI messages you can process in a block is only limited by your processor capacity. The offset parameter is used to get sample accurate timing. Generally if you receive a message at offset X, you will want to send out the processed message at offset X as well, unless you have a reason not to.
__________________
Mal, aka The Wasters of Time
Mal's JSFX: ReaRack2 Modular Synth
Time Waster is offline   Reply With Quote
Old 07-11-2018, 04:10 AM   #5
DarkStar
Human being with feelings
 
DarkStar's Avatar
 
Join Date: May 2006
Location: Surrey, UK
Posts: 19,677
Default


Thank you.
__________________
DarkStar ... interesting, if true. . . . Inspired by ...
DarkStar is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:06 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.