MDrummer. How does midi command works? I'm very confused :(

Official support for: meldaproduction.com
RELATED
PRODUCTS

Post

FL's VST host is a plugin in FL. Plugins in FL receive events inbetween processing buffers. So for the wrapper (the VST host), every event has a zero offset. There's just no way for it to know the event's actual offset.

In FL, events have a granularity of one processing buffer. The size of the processing buffer is one tick, which you can resize with the PPQ setting in the project settings window (F11), unless I'm mistaken (that's a part of the code I don't know myself).

For normal VST plugins this is not a problem, because they tend to process events while processing the buffer. So in the case of a zero offset, they'll first process the events and then the buffer, generating the sound that the notes represent.

The way your plugin is written, this isn't possible because you always delay events at least one processing buffer. At least that's how I understood it ... the way you explained it, it seems that you process events after you process the buffer. Otherwise I don't see how it could be a problem.

Post

reflex wrote:FL's VST host is a plugin in FL. Plugins in FL receive events inbetween processing buffers. So for the wrapper (the VST host), every event has a zero offset. There's just no way for it to know the event's actual offset.
I don't understand. What is host under what? :)
"FL's VST host is a plugin in FL" - it's night, so I may be dumb, but I just cannot decode it :D. Looks to me like FL and plugin are hosts for each other :D.

reflex wrote:In FL, events have a granularity of one processing buffer. The size of the processing buffer is one tick, which you can resize with the PPQ setting in the project settings window (F11), unless I'm mistaken (that's a part of the code I don't know myself).
Definitely not enough in default settings and configuring MIDI accuracy sounds reaaally weird, sorry.

reflex wrote: For normal VST plugins this is not a problem, because they tend to process events while processing the buffer. So in the case of a zero offset, they'll first process the events and then the buffer, generating the sound that the notes represent.
Not true, for example cubase (at least earlier versions, not sure about 5) likes to use processing buffers of the device. Actually most hosts do that. So if you have 5516 latency on your audio device, which was pretty common on sound-blasters :), then you would hear the notes 1/8 second out of time!
That's just NOT possible.

Let me ask you a question - why would the offset be there if you could just ignore it?

reflex wrote:The way your plugin is written, this isn't possible because you always delay events at least one processing buffer. At least that's how I understood it ... the way you explained it, it seems that you process events after you process the buffer. Otherwise I don't see how it could be a problem.
No no. First VST hosts usually (not sure if it is in standard, but I believe almost all of them do it that way) do this:
processEvents
process
processEvents
process
...

In processEvents you can ask for timing info (getTimeInfo) and host returns current state (such as PPQPos). However in your case I for example received PPQPos 4.01 or something for event that should be at 4.00, therefore too late.

(At least I hope I'm not mistaken, but I already checked 4 times...)
Vojtech
MeldaProduction MSoundFactory MDrummer MCompleteBundle The best plugins in the world :D

Post

MeldaProduction wrote:I don't understand. What is host under what? :)
"FL's VST host is a plugin in FL" - it's night, so I may be dumb, but I just cannot decode it :D. Looks to me like FL and plugin are host for each other :D.
FL by itself doesn't host VST plugins. Instead, we wrote a native FL plugin that in turn hosts VST and DirectX plugins. So this "Fruity wrapper" plugin is limited in a couple of ways, it doesn't have direct access to note information.
Not true, for example cubase (at least earlier versions, not sure about 5) likes to use processing buffers of the device. Actually most hosts do that. So if you have 5516 latency on your audio device, which was pretty common on sound-blasters :), then you would hear the notes 1/8 second out of time!
But FL doesn't do this. If you set the device's buffers size to an insane value, FL would still ask the plugin to process buffers of roughly the same size as it does now.
Let me ask you a question - why would the offset be there if you could just ignore it?
The offset was added for dealing with the situation you describe above, huge processing buffers that would normally lead to huge latencies when playing notes.

FL's buffer sizes have traditionally been small. The 200 sample buffers that FL sends in your example are about 4.5ms at 44.1KHz. I personally consider that small enough for most cases.
No no. First VST hosts usually (not sure if it is in standard, but I believe almost all of them do it that way) do this:
processEvents
process
processEvents
process
...
But processEvents is always called immediately before process, and also from the processing thread.
In processEvents you can ask for timing info (getTimeInfo) and hosts returns current state (such as PPQPos). However in your case I for example received PPQPos 4.01 or something for event that should be at 4.00, therefore too late.
Ok, so the actual problem then is that PPQPos is incorrect? Is this with FL 9.1 or an earlier version?

Post

reflex wrote:
MeldaProduction wrote:I don't understand. What is host under what? :)
"FL's VST host is a plugin in FL" - it's night, so I may be dumb, but I just cannot decode it :D. Looks to me like FL and plugin are host for each other :D.
FL by itself doesn't host VST plugins. Instead, we wrote a native FL plugin that in turn hosts VST and DirectX plugins. So this "Fruity wrapper" plugin is limited in a couple of ways, it doesn't have direct access to note information.
Well that's great, so why don't you add offsets?
Sorry but the timing is just important, you cannot ignore it...

reflex wrote:
Not true, for example cubase (at least earlier versions, not sure about 5) likes to use processing buffers of the device. Actually most hosts do that. So if you have 5516 latency on your audio device, which was pretty common on sound-blasters :), then you would hear the notes 1/8 second out of time!
But FL doesn't do this. If you set the device's buffers size to an insane value, FL would still ask the plugin to process buffers of roughly the same size as it does now.
Let me ask you a question - why would the offset be there if you could just ignore it?
The offset was added for dealing with the situation you describe above, huge processing buffers that would normally lead to huge latencies when playing notes.

FL's buffer sizes have traditionally been small. The 200 sample buffers that FL sends in your example are about 4.5ms at 44.1KHz. I personally consider that small enough for most cases.
No! 200 samples is not enough! I can feel the difference around 256 samples and there are people with much better ears then I have.

You simply don't have offset there, so ok, in that case I have to say that you should fix it. I know that would be a lot of work, but even if most of your users don't hear it, there will be people who will.
On the other hand the pattern editor in FL Studio seems very simple without any advanced timing (at least from a first sight), so maybe your users do not care... I don't know, I have just never seen anything like this.

reflex wrote:
No no. First VST hosts usually (not sure if it is in standard, but I believe almost all of them do it that way) do this:
processEvents
process
processEvents
process
...
But processEvents is always called immediately before process, and also from the processing thread.
In processEvents you can ask for timing info (getTimeInfo) and hosts returns current state (such as PPQPos). However in your case I for example received PPQPos 4.01 or something for event that should be at 4.00, therefore too late.
Ok, so the actual problem then is that PPQPos is incorrect? Is this with FL 9.1 or an earlier version?
I believe so. It may be some multithreading problem though, I can't say. It says 9.0.0.
Vojtech
MeldaProduction MSoundFactory MDrummer MCompleteBundle The best plugins in the world :D

Post

Forgot to say, that originally I believed the problem is not in badly reported PPQPos, but that events are send in the next block, thus just late.
Vojtech
MeldaProduction MSoundFactory MDrummer MCompleteBundle The best plugins in the world :D

Post

Could you try FL 9.1? Timing calculation has changed a little bit, it might be more accurate now.

Post

Ok, I'll try when I can, but I doubt that since the user probably tried that one and since MDrummer hasn't been working, there is probably the same issue. We'll see.
Vojtech
MeldaProduction MSoundFactory MDrummer MCompleteBundle The best plugins in the world :D

Post

I don't know if it will help, but it's best to test with the latest version so we're talking about the same thing :)

Post

So I installed 9.1, tried the test project, it worked, so I was like "juuu! nice!", but then I ran the debugger, just in case... :?

Ok, so in 9.0 event located at 4.00 came at 4.01. In 9.1 the same event comes at 3.79. Just to note, processing block sizes are 216 samples in most cases, sometimes weirdly jumping to other values. According to current tempo, 216 samples should equal approximately 0.01 quarter notes, so the event should come at 3.99.

Note that even with 3.99 the accuracy is too bad when you ignore offset as I stated already many times. With 3.79 it is just unusable. Funny thing is, that note lengths seem correct (1 quarter between on and off, or something like that) and to make it even more interesting, first note in the beginning of the song comes at -0.01, which is quite correct (I believe it should come at 0, but -0.01 is fine with me).
Vojtech
MeldaProduction MSoundFactory MDrummer MCompleteBundle The best plugins in the world :D

Post

Ok, I'll check this when I have some time.

Post

Could you send me a simple FL song that has this problem? Here the ppq position reported to plugins is definitely correct (exactly 4 at the start of a bar).

Feel free to pm me for my email address.

You are talking about the ppqPos field of VstTimeInfo, right?

Post

MeldaProduction wrote:Well, these are the results:

1) With Reaper you were a victim of the mess in octave numbering. Reaper indexes octaves from -1 for whatever reason. FL Studio from 0. Both of them are wrong I believe. Octaves should be counted from -2, at least most of the hosts such as Cubase or Live do that.

So just try to put all notes an octave down, to their C0, which is C-1 in reality. The way it is not you are triggering breaks every bar. That's pretty unusual, though it works if you disable "random loops". But still, it shouldn't be used like this, because breaks are just breaks :D.


Hope this helps.
Thanks. You helped alot.

In Reaper things are fine but in FLs still I have to use the trick you provided me with.

just two things to be solved yet ;

1. While starting the midi in FLs ; there is a cymbal sound that forces itself at the begining of each bar, I deleted the Cymbal track from all loops but it just keep appearing in the loops selector's Beat section. Even worse, the cymbal sound silence all other sounds when it appears.

2. (In FLs only and not in Reaper) when I triger/insert a loop by left mouse clicking - the loops keeps playing and it will not stop untill I hit stop at the Mdrummer's Loop Selector.


Thanks and await for your help again.
See you later.

Post

AMD wrote: Thanks. You helped alot.

In Reaper things are fine but in FLs still I have to use the trick you provided me with.
I'm afraid we didn't reach any conclusion with IL. It is enough to shift the notes microscopically. E.g. Cubase has time shift for each track, maybe FL has it as well...

AMD wrote: just two things to be solved yet ;

1. While starting the midi in FLs ; there is a cymbal sound that forces itself at the begining of each bar, I deleted the Cymbal track from all loops but it just keep appearing in the loops selector's Beat section. Even worse, the cymbal sound silence all other sounds when it appears.
Another interesting FL thingy :). I'll check again. Please also ensure you have the newest FL version, they changed timing, though it is still not correct and won't be... Anyway you can try disabling "crash after breaks" in rhythm playback settings.

AMD wrote: 2. (In FLs only and not in Reaper) when I triger/insert a loop by left mouse clicking - the loops keeps playing and it will not stop untill I hit stop at the Mdrummer's Loop Selector.
Well, this is actually not a bug. FL studio simply sends the MIDI note when you play it (though you said loop, in that case that's awkward...), so it appears as command. It cannot be disabled, because some people (including me :)) like to preview the rhythm when playback is disabled. Some hosts can disable this "sending notes when playback is off". If FL studio doesn't have it, I'm afraid you will have to "survive that" :D. You can temporarily use a different MIDI channel which does not contain any rhythm if you hate it too much.

Cheers!
Vojtech
MeldaProduction MSoundFactory MDrummer MCompleteBundle The best plugins in the world :D

Post

AMD wrote: just two things to be solved yet ;

1. While starting the midi in FLs ; there is a cymbal sound that forces itself at the begining of each bar, I deleted the Cymbal track from all loops but it just keep appearing in the loops selector's Beat section. Even worse, the cymbal sound silence all other sounds when it appears.
... Anyway you can try disabling "crash after breaks" in rhythm playback settings.
Well, even If I disable the "crash after breaks", Mdrummer keeps jumping to an empty area in the (Beat Section) while it's playing my loops in the (Intro Section).This causes the silence of other loops while they are playing. So, whether crash after breaks are disabled or not Mdrummer keeps jumping to an empty loop?
See you later.

Post

Ok, so please send me a project, so I can check myself what the hell is going on there...
Vojtech
MeldaProduction MSoundFactory MDrummer MCompleteBundle The best plugins in the world :D

Post Reply

Return to “MeldaProduction”