MDrummer. How does midi command works? I'm very confused :(
-
- KVRian
- 852 posts since 3 Aug, 2001 from Belgium
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.
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.
-
MeldaProduction MeldaProduction https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=176122
- KVRAF
- 14325 posts since 15 Mar, 2008 from Czech republic
I don't understand. What is host under what?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.
"FL's VST host is a plugin in FL" - it's night, so I may be dumb, but I just cannot decode it
Definitely not enough in default settings and configuring MIDI accuracy sounds reaaally weird, sorry.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).
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-blastersreflex 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.
That's just NOT possible.
Let me ask you a question - why would the offset be there if you could just ignore it?
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: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.
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...)
-
- KVRian
- 852 posts since 3 Aug, 2001 from Belgium
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.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. Looks to me like FL and plugin are host for each other
.
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.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!
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.Let me ask you a question - why would the offset be there if you could just ignore it?
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.
But processEvents is always called immediately before process, and also from the processing thread.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
...
Ok, so the actual problem then is that PPQPos is incorrect? Is this with FL 9.1 or an earlier version?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.
-
MeldaProduction MeldaProduction https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=176122
- KVRAF
- 14325 posts since 15 Mar, 2008 from Czech republic
Well that's great, so why don't you add offsets?reflex wrote: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.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. Looks to me like FL and plugin are host for each other
.
Sorry but the timing is just important, you cannot ignore it...
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.reflex wrote: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.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!
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.Let me ask you a question - why would the offset be there if you could just ignore it?
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.
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.
I believe so. It may be some multithreading problem though, I can't say. It says 9.0.0.reflex wrote:But processEvents is always called immediately before process, and also from the processing thread.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
...
Ok, so the actual problem then is that PPQPos is incorrect? Is this with FL 9.1 or an earlier version?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.
-
MeldaProduction MeldaProduction https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=176122
- KVRAF
- 14325 posts since 15 Mar, 2008 from Czech republic
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.
-
- KVRian
- 852 posts since 3 Aug, 2001 from Belgium
Could you try FL 9.1? Timing calculation has changed a little bit, it might be more accurate now.
-
MeldaProduction MeldaProduction https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=176122
- KVRAF
- 14325 posts since 15 Mar, 2008 from Czech republic
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.
-
- KVRian
- 852 posts since 3 Aug, 2001 from Belgium
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 
-
MeldaProduction MeldaProduction https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=176122
- KVRAF
- 14325 posts since 15 Mar, 2008 from Czech republic
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).
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).
-
- KVRian
- 852 posts since 3 Aug, 2001 from Belgium
Ok, I'll check this when I have some time.
-
- KVRian
- 852 posts since 3 Aug, 2001 from Belgium
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?
Feel free to pm me for my email address.
You are talking about the ppqPos field of VstTimeInfo, right?
-
- KVRist
- Topic Starter
- 222 posts since 5 Dec, 2007 from KSA
Thanks. You helped alot.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.
Hope this helps.
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.
-
MeldaProduction MeldaProduction https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=176122
- KVRAF
- 14325 posts since 15 Mar, 2008 from Czech republic
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: Thanks. You helped alot.
In Reaper things are fine but in FLs still I have to use the trick you provided me with.
Another interesting FL thingyAMD 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.
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 meAMD 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.
Cheers!
-
- KVRist
- Topic Starter
- 222 posts since 5 Dec, 2007 from KSA
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.
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?... Anyway you can try disabling "crash after breaks" in rhythm playback settings.
See you later.
-
MeldaProduction MeldaProduction https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=176122
- KVRAF
- 14325 posts since 15 Mar, 2008 from Czech republic
Ok, so please send me a project, so I can check myself what the hell is going on there...
