-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
More PPQN? #1530
Comments
On 12/30/2014 03:38 PM, Raine M. Ekman wrote:
When it comes to recorded MIDI, tick count isn't actually the biggest
Backwards compat will break in 2.0 anyway, so if we want to reconsider
That's not actually related. Non-integer tempo can be implemented just Non-integer tempo is actually just a matter of coding a widget that
Changing the number of ticks is not a small endeavour and involves lots |
120 BPM, 48 ticks = 10.4 ms/tick = 500 frames/tick at 48 kHz. More if the tempo is slower or sampling rate is higher, so a tick can easily be several times the period size. JACK MIDI has sample-exact events, so this could be even more relevant when (if?) that gets implemented.
I did grep a bit for DefaultTicksPerTact and hard coded 192s and 48s, it didn't seem that bad. I might've missed some of the finer details. |
On 12/30/2014 07:40 PM, Raine M. Ekman wrote:
It can, but still increasing the tick count won't increase the accuracy
Yes, but we'd still first need the code to read the timecode from those
Could be. We should still determine the performance implications of |
As part of a pruning effort, this |
IMO this should be a setting in Preferences, defaulting to 192 to preserve backwards compatibility. |
FL Studio saves this on a per-project basis, and defaults to 96 if I remember correctly. Raising this number has a fairly significant effect on performance. |
As a note to anyone who decides to tackle this, this line is based on the current PPQN: lmms/src/gui/editors/SongEditor.cpp Line 297 in e1ef5fa
A doubled PPQN value should give <guesswork> If PPQN is configurable, this needs to be updated whenever PPQN is, and that change needs to propagate down to whoever has called the function. Otherwise the user could cause a crash by lowering the PPQN while snapping to 1/128th bars </guesswork>. |
Just changing the This allowed me to do a little unscientific render benchmark, using a MIDI file of close to 7 minutes with 10 SF2 player tracks. I toyed around with the ticks and rendered using default settings, 3 runs each, average user time:
So, there is a bit of a performance hit, but it might be acceptable? Spots that would need further attention before this being ready for prime time are loading (and saving) of projects, and the song position display, which is way off. Probably a few other places as well. |
I have an alternative to increasing PPQ that seems to resolve "a bit on the low side for recorded MIDI and things like that" In Note.cpp add f_cnt_t m_noteOffset; which is a sample frames offset/delay for starting the note. When creating a NotePlayHandle add the note's offset.
This essentially means a note's start point is sample precise, we can play a note at any position in the track not limited in any way. Once this simple change is made setting a note's offset is a lot fun. Naturally, you can record with close to this precision, CPU delay impacts the recorded offset, but if you know it, you can compensate. On my PC this seems fast enough to record piano being played with no quantizing at all. roughly milisecond precise at 127bpm code for recording is somethign like this
You can also nudge notes around, so you have fine grained control of start position if that helps. You can also apply fine grained groove quantizing to make "funky" (swing) rhythms without having to program notes at the ppq level. Humanizing not timings is easy when offset is there, its just adding some random frames to the offset This branch has it working if anyone want to try it out |
example of groove quantizing on and off |
The trouble with storing note positions as a sample offset from a tick is that samples and ticks can change in relative size. There are three main units of time we have to deal with in LMMS: ticks, samples, and seconds. Ticks and seconds are related to each other by the tempo, and samples and seconds by the sample rate. Thus ticks and samples are related both by the tempo (which can vary within a single project) and the sample rate (which can vary across machines, and even across sessions on the same machine). I think for consistency and simplicity it would be best not to mix units like this. |
It works tho, and is cheap and easy and enables types of music currently not possible in Lmms. Other daws do ti's too.
If it doesn't work with bpm changes all that needed is documentation and perhaps a validation verification.
An alternative is to store the offset in parts of a tick é.g a float and calculate the frames offset in samples as the noteplayhandle is created. This would be a small amount of math, not free perf wise but very cheap, and would support dynamic bpm changes. Accuracy would be within a sample or two.
…On Wed, 29 Nov 2023, at 20:13, Dominic Clark wrote:
The trouble with storing note positions as a sample offset from a tick is that samples and ticks can change in relative size. There are three main units of time we have to deal with in LMMS: ticks, samples, and seconds. Ticks and seconds are related to each other by the tempo, and samples and seconds by the sample rate. Thus ticks and samples are related both by the tempo (which can vary within a single project) and the sample rate (which can vary across machines, and even across sessions on the same machine). I think for consistency and simplicity it would be best not to mix units like this.
—
Reply to this email directly, view it on GitHub <#1530 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAGGM6RWHAFNKABVPSDZV7TYG6CPFAVCNFSM4AZUXQFKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBTGI2TINJVHA4Q>.
You are receiving this because you commented.Message ID: ***@***.***>
|
On production chat we have
Fijiwada!* — *Today at 12:20 AM
Any tips for making house music?
I find it a bit strange you are looking for a way to *not* implement swing, its a pretty core feature.
…On Thu, 30 Nov 2023, at 10:28, teknopaul wrote:
It works tho, and is cheap and easy and enables types of music currently not possible in Lmms. Other daws do ti's too.
If it doesn't work with bpm changes all that needed is documentation and perhaps a validation verification.
An alternative is to store the offset in parts of a tick é.g a float and calculate the frames offset in samples as the noteplayhandle is created. This would be a small amount of math, not free perf wise but very cheap, and would support dynamic bpm changes. Accuracy would be within a sample or two.
On Wed, 29 Nov 2023, at 20:13, Dominic Clark wrote:
>
>
> The trouble with storing note positions as a sample offset from a tick is that samples and ticks can change in relative size. There are three main units of time we have to deal with in LMMS: ticks, samples, and seconds. Ticks and seconds are related to each other by the tempo, and samples and seconds by the sample rate. Thus ticks and samples are related both by the tempo (which can vary within a single project) and the sample rate (which can vary across machines, and even across sessions on the same machine). I think for consistency and simplicity it would be best not to mix units like this.
>
>
>
> —
> Reply to this email directly, view it on GitHub <#1530 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAGGM6RWHAFNKABVPSDZV7TYG6CPFAVCNFSM4AZUXQFKU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBTGI2TINJVHA4Q>.
> You are receiving this because you commented.Message ID: ***@***.***>
>
>
|
Right now LMMS is running 192 ticks/whole note = 48 PPQN (parts per quarter note). It might be a bit on the low side for recorded MIDI and things like that, and it looks like something like 960 PPQN is a pretty common number in other software.
Now, what would changing this mean? Some speculation:
The text was updated successfully, but these errors were encountered: