LMMS / lmms

Cross-platform music production software
https://lmms.io
GNU General Public License v2.0
7.79k stars 984 forks source link

Swing function. #1091

Open reory opened 9 years ago

reory commented 9 years ago

Hello new here.

I asked this question on the LMMS forum on facebook, it's not an issue but I was told to come here and sign up.

Is there any chance in the future of having a "swing" function on the bb editor?

http://blog.dubspot.com/swing-creative-use-of-groove-quantization/

Above link explains it better than I can.

Great work by the way on the new LMMS beta and I love all the new sounds from zynaddsubfx.

Thank you.

diizy commented 9 years ago

On 08/23/2014 11:52 PM, reory wrote:

Hello new here.

I asked this question on the LMMS forum on facebook, it's not an issue but I was told to come here and sign up.

Is there any chance in the future of having a "swing" function on the bb editor?

There's any chance of having anything, someone just has to implement it. Know any good coders?

reory commented 9 years ago

Hi Diizy.

Unfortunately I do not know any coders. I suppose if enough ppl want this function the priority would shift to making this happen.

diizy commented 9 years ago

On 08/25/2014 11:36 PM, reory wrote:

Hi Diizy.

Unfortunately I do not know any coders. I suppose if enough ppl want this function the priority would shift to making this happen.

Well, not really. This isn't a business, no one is paying us... people work on what they care about personally - which is how it goes for most open source software.

That said, a swing feature is definitely something that has been discussed in the past and it's something that may be implemented at some point. However, there's 101 things that need to be done before that... and not enough people to do those things.

drunkenjesus commented 9 years ago

If this is a really important feature you're missing you many wanna just look into a VST step sequencer that has the feature

http://bedroomproducersblog.com/2014/02/25/step-sequencer-vst/ < list of free step sequencer vst's I'm sure a few of them probably have a swing function

reory commented 9 years ago

OK. Thanks guys.

musikBear commented 9 years ago

And its a relative easy thing to do manually (mark & move notes 64'th to the left in a 4/4 tempo) Do you need a tutorial?

reory commented 9 years ago

@musikBear That would be great thanks. How would you showcase this tutorial?

zonkmachine commented 8 years ago

I've actually implemented swing before but this was on a much simpler hardware sequencer. Since we've seen coding on the MIDI side of LMMS lately, probably the most sane way to go about it would be through groove templates.

Here's an interview with Roger Linn as a bonus :) http://www.attackmagazine.com/features/roger-linn-swing-groove-magic-mpc-timing/

zonkmachine commented 8 years ago

probably the most sane way to go about it would be through groove templates.

I change that to: The easiest way is to have swing quantization in the Piano Roll editor. I don't think that would be picked up easily by the arpeggiator though but you wouldn't have to mess with the timing directly but just change the notes. I also had a look at the arpeggiator to see if it was feasible to make a swing knob in there but even if it's doable it would mess up the code pretty much. As I recall it that was the way it was done in Logic when I worked with it some 10+ years ago.

Basically a general algorithm for swing looks something like this: frames, swing_factor, swing_frames1, swing_frames2 swing_factor = swingKnob * frames swing_frames1 = frames + swing_factor swing_frames2 = frames - swing_factor step_in_beat % 2 ? swing_frames1 : swing_frames2

teknopaul commented 7 years ago

Hi I've actually done this. I had a version of LMMS locally with variable swing per track and a facility to add different groove functions as well as just simple swing. So far just the swing algo talked about above, I'd need to port it to the new github project.

My algo shifts the notes with more precision than just one 64th, to be honest shifting by 1 64th is pretty good, but I find 1 64th pretty limiting. (BTW technically in LMMS the limit is a 1 192th or a bar)

If there is still demand for this I'll see if I can create a pull request with the changes.

Perhaps one day might be nice to import groves from other tools? I think there are some formats for transferring grooves.

zonkmachine commented 7 years ago

If there is still demand for this I'll see if I can create a pull request with the changes.

Yes, yes, yeeees!!!

teknopaul commented 7 years ago

Done, https://github.com/LMMS/lmms/pull/3296 a bit rough round the edges but its a start.

teknopaul commented 7 years ago

I finished this, it supports save now, a simple UI and a couple of different groove functions as well as just Swing. I'm using it daily it seems pretty stable. I don't get how to submit the code though.

BaraMGB commented 7 years ago

Step 1: fork lmms on github. Step 2: clone your fork to your local computer Step 3: make a new branch (git checkout -b swing) Step 4: do your changes and test them. Step 5: git add . And git commit Step 6: git push origin swing Step 7: do the pull request on github

follower commented 6 years ago

I've just randomly found @teknopaul's groove support in #3296 via a snippet of diff context in another issue.

Given the interest in this functionality and all @teknopaul's effort implementing it, it seems a shame to stumble at the last hurdle due to source control tooling (believe me, I'm sympathetic on that count :) ).

From looking at https://github.com/LMMS/lmms/pull/3296/commits it seems like (in comparison to https://github.com/teknopaul/lmms/commits/master) only the 3 required commits now appear in the PR?

The Qt5 Travis builds seem to fail due to this error (e.g.):

/Users/travis/build/LMMS/lmms/include/Groove.h:29:10: fatal error: 'QtGui/QWidget' file not found

#include <QtGui/QWidget> 

Which seems to be related to a Qt 4 vs Qt 5 change (see).

I realise these things come down to available time but I thought I'd add this "current status" summary in case someone was inspired to take a look to get some cool functionality over the line (without, you know, having to implement the functionality themselves :D ) and/or to have some notes for myself if I get back to it first (unlikely in the near term due to how many yaks I'm in the middle of shaving currently :) ).

Thanks for your efforts getting it this far @teknopaul. :)

tresf commented 6 years ago

@follower thanks for resurrecting this. The issue is that @teknopaul closed his PR before the feature was tested and merged. I've reopened it for work to continue. If you are comfortable working on this, we'd happily add you to the dev team to nudge it along. Being on the dev team will give you access to push to his fork and get the feature implemented. (This statement is true for anyone that's willing to help us with PRs, BTW).

tresf commented 6 years ago

@follower I've rebased #3296 against master, fixed build errors.

rulatir commented 6 months ago

"Swing" is a very limited model. We need to be able to warp the timing of events using different, pluggable mathematical models. The "delay every second note by a fixed amount" model is just one of dozens that various musical systems around the planet actually need.

https://github.com/sjaehn/BSchaffl/issues/19#issuecomment-1158026883

teknopaul commented 6 months ago

"Swing" is a very limited model. We need to be able to warp the timing of events using different, pluggable mathematical models. The "delay every second note by a fixed amount" model is just one of dozens that various musical systems around the planet actually need.

sjaehn/BSchaffl#19 (comment)

I think it always has been pluggable with different models

teknopaul commented 6 months ago

I have another implementation that is based on a simpler approach with offsets in samples

https://github.com/teknopaul/lmms

This is very fast but does not survive large BPM changes very well. Also this code does not have a global groove always applied per song, it has groove that can be assigned per note select Ctrl + G.

All the different "Swing" algorithms are re implemented.

Same approach could be used with offset as a float in fractions of a tick which would survive BPM changes. I have not tried that but the same principal applies and each alog would need to be tweaked.

Both thesee approaches have the same feature that you can have different swing models in the same song.

The offset approach also allows for simple huamnization, and tuplets, flam and other tricks that require delays to not positioning.

Screenshot from 2023-12-20 16-55-40