This was based on a midi file arrangement by Fred Nachbaur from the imslp.org site published with a creative commons 3 licence, which I edited in MuseScore 2.3 and then converted the parts to Sonic Pi format using a processing script.
Individual parts are edited to meet certain restrictions then exports as musicxml files. I then use a script originally developed by Hiroshi TACHIBANA and I wrote three articles about it a couple of years ago.