Okay, due to large file size I started working with sublime, which is a fine editor. But I’m running into a weird glitch in my toolchain.
I can’t seem to get sonic pi to consistently reload the external file on subsequent runs. The files just define a bunch of methods/functions, notably the one called “arrange”.
I run the code, see a problem, try to fix it, and run again. But sonic pi doesn’t seem to be running the updated code, even though sublime saved it to the hard drive.
Here’s the code in question:
run_file "C:\\Users\\harry\\Desktop\\Scripting\\SonicPi\\YummyFillings.rb"
run_file "C:\\Users\\Harry\\Desktop\\Scripting\\SonicPi\\arrange_buggy.rb"
kick = :bd_ada
snare = [:sn_dolf, :sn_dub, :sn_generic, :sn_zome]
hat = (ring :hat_bdu, :hat_cab, :hat_cats, :hat_gem, :hat_gnu)
bass = :bass_foundation
test = :ambi_drone
use_bpm 120
##| arrangement = {bass => "q :e3 m7 asc,q,q,q", kick =>"q,q,q,q", snare => "rq,h,q", hat => "qt,et,tq,te,qt,et,qt,et"}
##| arrangement = {bass => "q :e3 m7 rand,q,q,q"}
arrangement = {test => "8w"}
defaults = {test => "cutoff: 70, release: 0.25, sustain: 4"}
envelopes = { test => "'amp',16" }
lfos = nil
trancegates = nil
effects = {:ambi_drone => ":flanger depth: 1" }
arrange arrangement, defaults, envelopes, lfos, trancegates
Is there a way to force sonic pi to read it again from the hard drive? It seems to be caching it and not recognizing that the file’s been updated.
My kludge is to close & reopen sonic pi after every edit, which is slow and annoying. Is there (please) a better way?
Thanks!