I am learning piano from a book and I can't understand the difference between swing and shuffle. I have searched, but I still can't understand the difference. Could someone please iterate the difference between swing and shuffle?
[I'm addressing 'swing time' and 'shuffle time', not 'swing style' and only indirectly bearing upon 'shuffle style'. Ulf raises a very useful distinction between these, I think.]
Swing covers a broader range than shuffle, which is a sort of crystalized swing.
If you start with strict time,
then squeeze the off-beats a little closer to the following beat you get swing.
Duh. da-Duh. da-Duh. Like a heartbeat.
If you squeeze further, the stretched beat and the squeezed beat approach the ratio of 2:1, so you can notate it with a quarter note and an eighth note. This is often notated at the top of the chart, eg. 2 eighth notes equals 1 quarter plus 1 eighth, then the music itself is written with straight eighth notes and you must add the swing to it.
Shuffle is a special case where the swing time coexists with a straight time and a good drummer will keep changing the emphasis between the two. Often written 12/8, it is 4/4 time. It is also 3/8+3/8+3/8+3/8 tie.
Bippity Boppity Bippity Boppity.
I suppose the difference, in my opinion, boils down to: swing merely squeezes the off-beat closer to the following beat; shuffle does this and also adds the middle note, locking the triplet in place. A piece can swing harder, approaching a dotted eighth plus a sixteenth. Or a piece can lightly swing, perhaps like a dotted eighth plus a regular eighth. But you cannot shuffle any more or less; you're either doing it or you're doing something else.
Let's divide the question into (A) playing with a swing or shuffle feel, and (B) performing music as in swing or shuffle musical genre style.
(A) Playing with swing or shuffle feel means to play with swung eighths1 (or to employ "triplet feel" eigths) - which means that the first eighth of a beat gets a longer duration than the second. Also off-beats are generally emphasized, or syncopated. Performing this is conceptually pretty much the same for swing and shuffle music.
(B) The difference between performing music as swing, and performing music as shuffle, I'd say, lies in that you'd expect different styles of accompaniment. I.e. if you just hear a phrase played solo with swung eighths, and/or some other trait of swing or shuffle timing/phrasing/emphasis, you can't necessarily tell whether the song is performed as swing or shuffle (unless the phrase uses phrase elements typical of jazz/swing or of some shuffle genre). Especially since a soloist can be very free in the timing of the swung eighths. But when you add accompaniment you can tell by the style the drums, guitar, and piano (or other accompanioning instruments) are playing.
For instance swing drumming could typically be played
So when playing the melody or a solo on the piano you don't need to worry too much about the timing in terms of it being swing or shuffle; just find a swung eighths timing and syncopation that you feel "swing".
However there is no universal definition on what swing nor shuffle is so you'll likely get different answers from everyone you ask.
Someone wrote "Shuffle is the swing of the blues" and maybe that statement can give some guidance.
1The swung note value can be other note values than eighths - such as sixteenths - but eighths are the most common.
Swing can differ a lot depending on the musician. Listen to the 8th notes of 50's swing and you'll find it's very jumpy. It's rather achieved through time values. Swing these days is different, it's more achieved through changing note volume (you can play straight 8ths but emphasizing every other 8th and it will sound sort of like swing, practising this will make it more natural and subconciously you might change time values, too).
In general you have to make out for yourself what kind of swing you want, and just practise it by listening to the musician that has the swing you want.