prize17-2, Exercise 2: A different ratio and tempo bpm = 160 ratio = 3 # long note is 3 times the short note beat = 60 / bpm # 0.375 seconds short = beat / (ratio + 1) long_ = beat - short print("swung:", [round(long_, 3), round(short, 3)]) print("sum :", round(long_ + short, 3)) Expected output: swung: [0.281, 0.094] sum : 0.375 (Check by hand: 0.375 / 4 = 0.09375, and 0.375 - 0.09375 = 0.28125, which round to 0.094 and 0.281.) Why it works: if the long note is ratio times the short one, the beat divides into ratio + 1 equal parts, one for the short note and the rest for the long. A ratio of 2 gives the triplet figure from the chapter. Care: subtract to get the long note rather than rounding both, so the pair always adds up to the beat.