Hi Bruce. It probably took around an hour and a half to produce the piece. I start with a midi file and load it into MuseScore 3. There I produce separate parts and ensure that the parts adhere to some constraints. In particular if a part contains two or more voices these have to be separated to separate parts, and there are also contraints with tied chords. Recent changes in muse score mean that rest pars have to be replaced with a rest equivalent to the bar duration eg a 4beat great rather than a bar rest symbol. Multiple bar rests have to be expanded and replaced for example using five individual bar rests rather than representing it with a bar rest marked 5. Once this is done save the MuseScore file thenI export the parts as uncompressed musical files. The reason for saving before export is that there is currently a bug in MuseScore which causes the program to crash during the first export. You restart and restore the file then on the second and subsequent exports it works!
The exported files are then fed into a script by Hiroshi TACHIBANA written in Processing which I discuss in two articles which produces Sonic Pi language code. The scripts can cope with tempo changes provided that they occur in every part at the same time. Each part is processed separately by the script and the rustling text is copied and pasted into an editor (I use Visual Studio Code editor on my Mac) where it is tidied up. For example at that stage I write the play notes function and just paste in the notes and duration lists for each part to assemble the final program, adding pan info reverb synth choices etc.
The process sounds fairly horrendous and involved, but if you use it frequently it becomes quite slick and quick. I have produced many many pieces using this technique.
As an aside, I wrote the Gesualdo piece over three years ago. Two changes I would incorporate now for the latest Sonic Pi versions. First I would limit the amplitude of each part following changes in the audio processing and add use_synth_defaults amp: 0.5
for this piece. Secondly rather than using the zip function I use code more in keeping with Sonic Pi using tick and look
This gives the new complete code for the piece shown below. As before run it using
run_file "path-to-file/Luci_Serena-Gesualdo-RF.rb"
#Luci_Serena-Gesualdo-RF.rb
#coded for Sonic Pi by Robin Newman. This version December 2022
use_synth :tri
use_synth_defaults amp: 0.5
rm =0.2
use_bpm 120
define :playnotes do |notes,durations,pan=0|
notes.length.times do
play notes.tick, sustain: (durations.look)*0.9,release: (durations.look)*rm,pan: pan
sleep durations.look
end
end
with_fx :reverb,room: 0.8,mix: 0.7 do
a1=[:C5,:C5,:C5,:C5,:D5,:F5,:D5,:r,:r,:C5,:Bf4,:A4,:D5,:Bf4,:D5,:A4,:D5,:C5,:D5,:G4,:r,:r,:D5,:Bf4,:Ef5,:Ef5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