This is based on the coconet model transforming another Bach chorale. Ach Gott, vom Himmel sieh darein (Oh God, Look Down From Heaven). This chorale uses a lot of notes outide the primary key of D minor. Coconet did his best to harmonize it. I scored it for some samples that I made myself, and don’t have any licensing issues. The instruments are two different finger pianos, one full, and another just for bass notes, plus some Ernie Ball guitar strings, and other assorted strings sounds.
I used the same basic manipulation techniques on this one: stretch out the interesting parts, and repeat them in different ways. This version includes code to randomly choose among several different manipulations:
if final_length > 10: probability = ([0.1, 0.05, 0.05, 0.1, 0.1, 0.05, 0.15, 0.05, 0.15, 0.2])
else: probability = ([0.2, 0.1, 0.06, 0.1, 0.1, 0.15, 0.04, 0.05, 0.1, 0.1])
if type == 'any':
type = rng.choice(['tile', 'repeat', 'reverse', 'tile_and_reverse', 'reverse_and_repeat',
'shuffle_and_tile', 'tile_and_roll', 'tile_and_repeat', 'repeat_and_tile',
'tile_reverse_odd'], p = probability)
print(f'time_steps: {clseg.shape[1] = }, {factor = }, {type = }')
So I control the likelihood of picking different techniques for longer repetitions, favoring ’tile_and_roll’ and ‘repeat_and_tile’. The former tiles the section, basically repeating it note for note, but each time it rolls the notes, so it starts at a different point in the array. Repeat and tile takes half the voices and tiles them, and the other half it just makes them longer. It all works out in the end.