<pre style="word-wrap: break-word; max-width: 694px;"><code style="display: block; background-color: #f9f9f9; overflow: auto; padding: 5px;; background-color: #f9f9f9; padding: 2px 5px;">=0D
// This expects two keys to be defined: ~history (the list) and ~recordKey (which key to record)=0D
Pdef(\keyRecorder, Pbind(=0D
\callback, Pfunc({=0D
|event|=0D
event[\callback].addFunc({ // combine your record func with any previous callback that was there (it's okay if its nil)=0D
~history.add(currentEnvironment[~recordKey])=0D
}).postln;=0D
})=0D
));=0D
=0D