Implementing simple swing amount

jonbenderr's icon

I've searched the forums a bit and everything is a little more advanced then what I believe I need.

Have a metro running a counter that steps through a live.grid.

What's the best way to implement swing with a percentage gui element?

What relevant objects should I be looking at?

Wetterberg's icon

Think about what you're looking to do. You want to take a straight rhythm and turn it swung, yes?

If you connect a %2 object to your clock every even value will be "0" and every odd number will be "1".

That means we can use this to process odds and evens differently. Look into "gate 2" to route odds and evens to different processes.

So if you're counting from 1 to 16 then you'll need to delay your even values. [Pipe] is ideal. This is where you'll apply your percentage.

And you already know what 100% is, since that's the interval of the metro at the top of the patch. So you can readily take that timing value and multiply by between 0. and 1.

jonbenderr's icon

Interesting. You actually just revealed the real problem I'm having which is understanding the theory/math behind swing. Ha!

I understand usage of all the objects you've mentioned and kind of understanding what you're spelling out for me. Will have to do some googling and come to an understanding with what swing actually is and hopefully come up with my own system to achieve it.

Thanks for the help.

Christopher Dobrian's icon

I think @Wetterberg has described the principle fairly well.

Here's an example that's quite similar to what he described (with some differences of implementation), with some explanatory text.Example 25: Bass drum player with swing

jonbenderr's icon

Wetterberg did an excellent job. Just made me realize I don't entirely understand what swing is.

I've used swing in different scenarios before, but it has always just been a "this makes things sound groovy" sort of thing. In order to understand any suggestions of how to go about creating the effect in the max world, I first need to understand what the effect actually is. If that makes sense at all.

Christopher Dobrian's icon

Understood.

'As you know, in various styles of jazz and popular music, 16th notes are played unevenly, with the duration of the first of each pair of 16ths being slightly longer than the second. You might just as well say that the onset time of the second of each pair of 16th notes is delayed slightly. This practice is known as "swing". Scientific musicologists who have studied the performance of music that involves swing have found that the amount of swing varies from one style of music to another, and is also dependent on the tempo of the music. So, rather than try to quantify swing as some particular rhythmic unit, such as a triplet 8th note, it may make more sense in computer music to quantify swing as some percentage of a beat, or of a half beat. That's how we do it in this patch. If you figure that normally an unswung 16th note is 50% of an 8th note (120 ticks for a 16th, and 240 for an 8th), then a swung 16th note might range from 50% (no swing) to 75% (extreme swing equal to a dotted 16th note) of an 8th note.'

ctrlzjones's icon

Apologies for the sauciness, again it seems too difficult to bite my tongue hard enough to shut up on this ...

The phenomenon of swing is a quality of a human emotion that has not yet been put down to algorithm. It is a feeling of urge something that drives you, like 'love', way to complex to be quantifiable in floating point units. There is a lot to say about to say about humanity and technology e.g. computers and this is obviously not a place to continue ...

Apart from this you may consider that the experience of time (which 'swing' is heavily related to) is relative. As we know since Einstein Time does not exist by itself; instead it is a result a relation, something that it is compared to. In music this certain tension comes from a relation between an implicit beat (the meter) and what people are playing 'on top of it'. Again, it is a feeling. It it is easier being created if there is something played in relation too. A second sound, could be a cymbal and snare or drums and bass.

The other very important factor for swinging that is very much ignored is not a displacement of the sounds in time, but accents. To play some of the notes with more emphasis, louder or with a different adsr. This is where the meter comes in, the classification of 3/4 and 4/4 tells where the 'strong beats' and how to phrase correctly.

In jazz music (or early blues forms) where I would say the swing-thing originates, the timing is even more complex. It is often said, that the accents in a 4/4 swing beat should be in 2 & 4 (instead of the 1 & 3 of european marches and other classical music Bach, Beethoven; not Bartók, he had other rhythms going on, influenced by eastern gypsy, that is like african music also coming out of an 'oral culture', not written down but 'told')

So if listen to Charlie Parker or Coltrane you will find that the beats are pretty straight (as opposed to 'shuffle' that is something different, sometimes mistaken as swing. But there is, of course a swinging shuffle ;-) but the accents in the eightsnotes sequences are in 'strange' places and phrases are starting and ending almost never on the 'full beats' but on the 'eights'.
This is coming from the polymetrics in african tradition. The 'african pile of rhythm' is not a division of binaries, with some triplets squeezed in, but an overlay of 4/4, 6/8, 7/8 and whatever ...

This is again a relational thing, a friction of contrasts, that creates a tension in the experience of being human. And no, we still do not know if the egg was before the chicken, but we know that man was before the machines, before the two (will be) merged.

jonbenderr's icon

That's a very romantic response to the topic at hand. I guess I should be more clear.

I am trying to mimic the old swing functions on classic groove boxes and sequencers. I'm pretty sure there were some pretty straight forward algorithms involved in achieving these. Maybe not.

Christopher Dobrian, thank you very much for the help. Starting to get my head around the concept to the point where I can start experimenting with @Wetterberg original suggestions.

kleine's icon

You might look at classic hardware solutions - swing was usually achieved via a clock driven pulse generator where the swing was just the pulse width shift of a square wave (triggers at rising and/or falling edges)…. just an idea.

jonbenderr's icon

Ok...abandoned what I was working on here for a bit and am now back at it and wanted to clarify a few things. Apologies for dredging up an old thread.

WETTERBERG describes the process as delaying even values to achieve swing. Makes sense and simple enough to implement from the first look.

However, reading Christopher Dobrian 's explanation of swing, it's all about even numbered 1/16th notes.

So if I have a Metro @8n running a 16 step counter, technically every even 1/8th note is still an odd 1/16th note, so it seems as if the processing would be different from @Wetterberg 's description, no?

Or is it really as simple as just delaying even numbers no matter what? Or do I not even bother delaying anything but 1/16th notes? Keep in mind, title of thread involves "simple". Just want something to add a little groove. Doesn't have to be an exact representation.

Roman Thilenius's icon

two important points by zeta here, which are far more but "only" philosophy:

1.) to create "swing" dont neccesarily recreate how logic audio or the MPC are doing it. there are other ways. you can do it backwards (and have a predelay on every odd beat), you can use more than one "swing factor" (1 on every second, one on every 4th beat) ...

2.) "accenting" events can be as interesting as modulating the timeline. or why not combine both ...

-110

Wetterberg's icon

1) Absolutely! Also, very little goes a long way. One of the grooves we use has a strong delay on the 3rd beat, makes for a fantastic stumble.

2) I agree so much with this point. Driving a coll with a velocity pattern in it is a great system, I find.

Roman Thilenius's icon

2) or lock the gain accent to the delay time, both based on their distance from the listener.

Wetterberg's icon

Oooh! I absolutely have to try that! :-o

jonbenderr's icon

Thanks guys. Was actually able to come up with something based off of what Wetterberg originally suggested. Also recorded some midi from k-devices Autobeat to get a little better grip on what I wanted to do.

Not to say these other suggestions are being ignored. Actually working on something else where these ideas might be pretty cool to inject.