Created
March 21, 2026 14:52
-
-
Save scztt/9ee630f13c4cb0bce84af131ad9907af to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ThreadPostln { | |
| classvar <>all, <>lastChar; | |
| *initClass { | |
| all = (); | |
| lastChar = (); | |
| } | |
| } | |
| +String { | |
| postln { | |
| thisThread.threadPostln(this); | |
| } | |
| post { | |
| thisThread.threadPost(this); | |
| } | |
| prPostln { | |
| _PostLine | |
| ^this.primitiveFailed | |
| } | |
| prPost { | |
| _PostString | |
| ^this.primitiveFailed | |
| } | |
| } | |
| +Thread { | |
| name_{ | |
| |name| | |
| ThreadPostln.all[this] = name | |
| } | |
| name { | |
| ^(ThreadPostln.all !? _[this] ?? { | |
| parent !? _.name | |
| }) | |
| } | |
| postLastChar { | |
| ^(ThreadPostln.lastChar !? _[this]) | |
| } | |
| threadPostln { | |
| |str| | |
| var threadName = this.name; | |
| if (threadName.notNil) { | |
| "[%] ".format(threadName).prPost; | |
| }; | |
| str.prPostln; | |
| } | |
| threadPost { | |
| |str| | |
| if (this.postLastChar === "\n"[0]) { | |
| if (this.name.notNil) { | |
| "[%] ".format(this.name).prPost; | |
| }; | |
| }; | |
| str.prPost; | |
| ThreadPostln.lastChar !? { |e| e[this] = str.last }; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ( | |
| Pdef(\foo, Pbind( | |
| scale: Scale.hexSus, | |
| degree: Pseq([1, 5, 4, 2, 8], inf).trace, | |
| dur: 1/8, | |
| )).play; | |
| Pdef(\foo).player.routine.name = "Pdef(\\foo)"; | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment