Add a swing/shuffle effect to playback/export
Submitted by lasconic on September 26, 2009 - 4:02pm.
| Project: | MuseScore |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I started to implement a swing/shuffle effect.
I think I have the algorithm ok. Bur for the moment the "swing ratio" is hard coded.
I wonder where and how users might want to choose this swing ratio.
- For the whole piece? for a staff? for a measure?
- With predefined value (swing = a quarter note and an 8th in a tuplet, shuffle = a dotted eight and a 16th)
- With a number between 0 (straigh) and 100 (extreme) with 33% for swing, 50% for shuffle... More than shuffle makes sense?
What do you think?
Attached a midi with ratio 0.333 of Promenade
| Attachment | Size |
|---|---|
| Promenade-swing.mid | 4.47 KB |
This looks like a great addition.
If it is not too complicated I would suggest that the user-definable selection be a choice of all 3 that you suggest.
It is complicated ;) At least for me. So I would like a more precise insight. What's number one priority?
My personal point of view for the moment is to add a style settings in Edit style -> Score and let user choose with a number.
Then I would suggest that it be part- or staff-selectable rather than score-selectable. A bit more work for the user, perhaps, but a wider range of choice.
Thanks for all your work.
Regards
Although it is very rare, there are times when a part might switch to straight eighths while other parts continue to swing eighths. I have never encountered a piece that has a light swing in one part and a heavy swing in another part; it is either swinging or straight.
In most pieces the swing applies throughout the whole piece but there are instances when it might change midway through a piece. Compilations (such as an arrangement of several movie themes or Christmas tunes) might change styles dramatically at several points throughout the piece.
I don't think the swing settings belong in the the Edit General Style dialog. The style dialogs deal with printed styles and should not mix with playback settings. Swing settings belong in the Play Panel (possibly the Synthesizer) and probably Tempo Text properties (for mid-piece changes).
Take a look at how swing settings are implement in other scorewriters
I think a drop-down menu of present options for swing would be more helpful than a number in a text box since it relates to terminology musicians would be familiar with. For example Finale offers the following four presets for swing "Light", "Standard", "Heavy", "Dotted Eighth, Sixteenth".
In the previous comment I mentioned Tempo Text properties. However it probably better belongs in the generic Staff and System text properties.
As far a priorities: (1) whole score settings for swing (2) measure-by-measure settings for swing (3) part-by-part settings for swing.
Probably the last option (part-by-part settings) could be implemented similar to dynamics which (in theory) can affect a single instrument or a whole system.
Thanks for the answer! It's very helpful! I will try to do something in playback panel tomorrow.
I might need help to define the ratio for every presets.
I commited a first attempt in r2137. Please review the code and the implementation.
For the moment it's just "Straight", "Swing" (0.333) and "Shuffle" (0.50). And it acts on the second eight notes only.
Wonderful start! Two points to look at:
The swing/shuffle modification should only apply to groups of two eighth notes. For example, if you have a group of four sixteenth notes they should sound like four equally spaced sixteenth notes regardless of the swing/shuffle setting. In r.2137 the last two sixteenth notes sound shorter than the first two which is incorrect.
As you mentioned above, the duration of the first eighth note needs to be lengthened so that you don't get a gap in the sound.
The swing/shuffle modification should only apply to groups of two eighth notes.
I will need help here. I agree with you for 4 sixteenths,
But I'm not sure at all for a 8th and two sixteenth.
And what about 2 sixteenths and an 8 th?
8th rest and 8th
eight and a triplet of 16th ? etc
We need to figure out a rule or a reference implementation in a existing software.
I think you'll generally find that swing needs only apply to 2 eighths. The other scenarios you describe, if they need to be swung, can be individually notated.using triplets.
Some litterature about swing and shuffle for reference:
http://en.wikipedia.org/wiki/Swung_note
http://www.acoustics.org/press/137th/friberg.html
Lasconic, if you don't already have a copy of Finale or Sibelius I recommend you download a demo copy and experiment with the swing tempo there. You will find that it applies only to groups of two eighth notes. The first eighth note of the beat is longer, the second shorter. No other combination of notes is affected by the swing.
I was mistaken. I only checked in Finale and it confirmed what I thought but Sibelius actually behaves differently. In a group of four sixteenth notes the first two notes are lengthen and the last two shortened. In Finale it plays sixteenth notes straight but in a group of two sixteenth notes and one eighth note it plays the first two sixteenth notes straight and shortens the eighth note. All other groups of sixteenth notes and eighth notes appear to play straight.
In r2150, 4 sixteenth notes are straight. The duration of the first 8th of a group of two is increased by the ratio.
The second 8th of a group, even a group of 2*16th and a 8th, is shiften and shortened.
Quoting David Bolton: "As far a priorities: (1) whole score settings for swing (2) measure-by-measure settings for swing "...
for (2) how about about making Swing/Shuffle as a tempo marking?
I agree with tato. I always thought the swing setting should never have been in the play panel in the first place. It properly belongs in the tempo properties. Furthermore, I think setting up the tempo should be part of the new score wizard. Of course I certainly don't mean to belittle the achievement, I'm sure there were reasons it was done that way and it is a great addition.
I still think that there should/could be a swing dialog on the play panel (along with the tempo marking) but not to apply swing or not, but to select the kind/amount of swing on "swinged" parts, because as David said on #4, the kind of swing would almost always be the same throw out the peace, on the other hand changes between swing and shuffle are very common.
There are many compositions that have more movements (symphony, quartet, ...). Nonartifitial music of 20th century has gived new styles of playing such as swing. Some composers of modern classical (George Gershwin, Leonard Bernstein, Bohuslav Martinů, and many more) use nonartiffitial styles and allso swing, blues, etc.
So it has good sense to can set "swing" for a part of score and switch it off by setting "straight". It is not only spetial set of occasional collection
In Sibelius you can write system text and there is dictionary of play modes. But there is not possibility set ratio. Only textual diference - light swing, regular swing, heavy. (I think number should not be bad but for some people may be better text.)
And what shall be swinged? Maybe count period - the denominator of time signature. For 4/4 it could be 8th, for 8/8 16th and so on - half of count period. But...!? I'm not sure.
Lasconic, I tested your algorithm and it sounds better than Sibelieus. 16ths of Sibelius stumble or cripple if they are four together.
Good job. Now I would like to have possibility to write swinging (or straight) into a score to concrete measure and maybe to concrete note from that i wont to swing (or stop swinging).
Sorry for waking up a long silent post, but I wanted to chime in on the utility of having the swing in the play panel. I use this program to practice (a lot). Sometimes when I'm doing rhythm studies I want an easy way to switch between straight, swing, and shuffle. With the recently added metronome, I'm loving this workflow.
While I agree on the previous posts about the most correct ways of implementing it for a score, having the option in the play panel is very helpful to me.
This question was revived and I would like to respond to this: "I wonder where and how users might want to choose this swing ratio.
- For the whole piece? for a staff? for a measure?"
Personally I could use control over this with a measure as the smallest segment.