Manipulate a list representing Bach's Prelude in C
This is a perfect application of a user-defined function:
chorale[x_] := {x, x[[3 ;; 5]], x, x[[3 ;; 5]]} // Flatten;
Then you can form the complete piece by mapping the function over the data bwv846:
chorale[#] & /@ bwv846
though you'll have to add the finale on separately.
Thee is no reason not to do it with Table
; the computation can be reduced to
tblBWV846 =
Flatten[
Table[
ConstantArray[{bwv846[[i]], Take[bwv846[[i]], -3]}, 2],
{i, Length[bwv846]}]];
Beautiful music. Thanks for posting this question.
Update
The code golf version
mainBWV846 = (ConstantArray[{#, #[[-3 ;;]]}, 2] & /@ bwv846) // Flatten;