Smalltalk SuperCollider is a Smalltalk library for working with the SuperCollider synthesiser.
Smalltalk SuperCollider is research quality, it has minimal documentation and the current implementation is in terms of Haskell SuperCollider, which is required in addition to a Smalltalk image.
It does work though, and it may be of interest to people familiar with SuperCollider, Smalltalk and Haskell.
Smalltalk SuperCollider also includes an interpreter for Smalltalk programs where the only data type is the SuperCollider Unit Generator. This interpreter (called âstsc3â) can run the example graphs in the âhelpâ sub-directories directly, without requiring a Smalltalk system.
Smalltalk SuperCollider works with Squeak, GNU Smalltalk, Pharo and Cuis. There is an Emacs mode for working with either GNU Smalltalk or the stsc3 interpreter.
It should be relatively simple to add a mechanism for communicating directly with SuperCollider, patches welcome.
Hello. Briefly, if you do to try and set this up, and if youâre not particularly familiar with Haskell, let me know and Iâll write some instructions. Itâs perhaps not obvious how to get all the pieces working. It might almost be easier to write the Smalltalk code to talk to SuperCollider language, if you know Smalltalk well? Iâm not sure. Youâd need a SuperCollider equivalent of the file below, Best, Rohan
No particular idea. Actually, there are many particular ideas but theyâre all very speculative. Itâs just a small experiment. I very much like Smalltalk and SuperCollider and I wanted to connect them up. Also Iâve been thinking a lot about Kyma this last year, and about persistence (as in âthe continued or prolonged existence of somethingâ, as in âImage-based persistenceâ). Best, Rohan
Thanks Rohan I would appreciate the instructions to get it working with Haskell if you have the time! I got as far as fileIn the indicated files in Squeak. I do sort of wish that sclang had simply been written on top of SmallTalk !
I just learned a bit more about the new Haskell package system and actually it might be (relatively) straightforwards!
I think if you install ghc and cabal for your system (Iâm on debian testing so Iâd type sudo apt install ghc cabal) and then fetch hsc3-graphs from the address above you should just be able to run cabal install from the hsc3-graphs directory.
It will think about things for a little, download some more git archives, compile everything, and put the finished program somewhere slightly obscure (here it was at ~/.cabal/bin/).
(If you already fetched hsc3-graphs youâll need to update it, ie. git pull, because I had to add an extra file for this process to work.)
Let me know if it doesnât work for you? The process is very new to me.
Also I think itâs very nice having a simple self contained special purpose interpreter for SuperCollider!
Particularly, in 1996 Iâm not sure you really wanted to be running Squeak1 on a 8100/80. (Or Squeak2 in 1998 on a G3, which I guess is the SC2 reference point.)
Youâll need to refetch and recompile hsc3-graphs and also get a copy of the hsc3 archive (see address above, or https://gitlab.com/rd--/hsc3).
Then youâll need to set HSC3_DIR to point to where you put hsc3, using the syntax for your shell (here I had to write export HSC3_DIR=$HOME/sw/hsc3).
After that, you donât need to run hsc3-graphs yourself, the Smalltalk system does it for you.
This arrangement is because I already had hsc3-graphs here, so when I was writing the Smalltalk code I made it print out a hsc3 version of the graph and then call hsc3-graphs to play it, or draw it.
It would make at least as much sense to write a SuperCollider language graph, but thatâs not what I did.
So from Smalltalk you can do 'jmcc-why-supercollider.st' evalFile play or use the SC3Browser (select graph, right click for menu) and so on.
Smalltalk will write a temporary .hs file and call hsc3-graphs on it.
I first try playing a fragment from the command line to be sure that hsc3-graphs is workingâŚ
but get these errors (and hen many more similar)
m
/var/folders/xx/6v0ml_rn3_l0kty1sy2fs3jh0000gn/T/rw.hs:6:1: error:
Could not load module âSystem.Randomâ
It is a member of the hidden package ârandom-1.2.0â.
You can run â:set -package randomâ to expose it.
(Note: this unloads all the modules in the current scope.)
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
|
6 | import System.Random {- random -}
| ^^^^^^^^^^^^^^^^^^^^
/var/folders/xx/6v0ml_rn3_l0kty1sy2fs3jh0000gn/T/rw.hs:8:1: error:
Could not load module âSound.SC3â
It is a member of the hidden package âhsc3-0.20â.
You can run â:set -package hsc3â to expose it.
(Note: this unloads all the modules in the current scope.)
It is a member of the hidden package âhsc3-0.19â.
You can run â:set -package hsc3â to expose it.
(Note: this unloads all the modules in the current scope.)
Use -v (or `:set -v` in ghci) to see a list of the files searched for.
|
8 | import Sound.SC3 {- hsc3 -}
Iâve made some changes to hsc3-graphs and stsc3 and hsc3.
I think the below will make it work, if you have any patience left!
git update all of the above (ie. hsc3, hsc3-graphs and stsc3)
in hsc3-graphs type cabal install to rebuild the hsc3-graphs binary (you may need to set cabals's overwrite-policy, itâs set to always in .cabal/config here, else I think it might not actually get installed)
run filein on stsc3/st/SC3-Haskell.st in your Smalltalk (thatâs the only st file edited)
in hsc3 type cabal v1-install (note the v1- prefix, itâs important!)
After that I think the below should work (for wherever you have hsc3, thereâs a new min argumentâŚ)
$ hsc3-graphs fragments hs min play ~/sw/hsc3/Help/Graph/jmcc-why-supercollider.hs
And if that works, then Smalltalk should work too.
I hope I havenât left anything out!
Apologies again, teethingâŚ
Best,
Rohan
Ps. Also none of the above will start scsynth! Youâll need to start it separately, from scide or the command line or however you normally start it. Also the above assumes that scsynth is listening at the default UDP port, which is 57110. Also it assumes that there is a group node 1, which sclang will make for you, but which you wonât get if you start scsynth on the command line.
Pps. Another quirk, the SC3Browser isnât super portable. It works in Squeak, but in Pharo you canât play graphs from the editor, thereâs a right-click menu that only works in Squeak⌠This is a problem for files that have more than one graph in them, because these canât be played from the top-level of the browser! I think thereâre only a few files like that though. I donât know what to do about the Squeak/Pharo situation.
Hi Rohan - no apologies necessary, it is you who is giving something for nothing not I! - glad to forge ahead if you are!
after git pull on all three repos, cabal install on hsc3-graphs gives me
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] next goal: hosc (user goal)
[__0] rejecting: hosc-0.20 (constraint from user target requires ==0.19)
[__0] rejecting: hosc-0.19.1, hosc-0.19, hosc-0.18.1, hosc-0.18, hosc-0.17,
hosc-0.16, hosc-0.15, hosc-0.14.1, hosc-0.14, hosc-0.13, hosc-0.12,
hosc-0.11.1, hosc-0.11, hosc-0.10.1, hosc-0.10, hosc-0.9, hosc-0.8, hosc-0.7,
hosc-0.6, hosc-0.5, hosc-0.4, hosc-0.3, hosc-0.2, hosc-0.1.1, hosc-0.1
(constraint from user target requires ==0.20)
[__0] fail (backjumping, conflict set: hosc)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: hosc