I came across this again recently and I’m still proud of it so thought it would be fun to re-share it here for a new audience. This also gives a good view of the state of Sonic Pi three years ago(!) and how far it has come.
For those who are interested, the pattern slicing stuff is in the codebase but currently commented out:
This file has been truncated.
## encoding: utf-8
# This file is part of Sonic Pi: http://sonic-pi.net
# Full project source: https://github.com/samaaron/sonic-pi
# License: https://github.com/samaaron/sonic-pi/blob/master/LICENSE.md
# Copyright 2013, 2014, 2015, 2016 by Sam Aaron (http://sam.aaron.name).
# All rights reserved.
# Permission is granted for use, copying, modification, and
# distribution of modified versions of this work as long as this
# notice is included.