Elixir implementation of Supercollider client.
- add
supercollider
to your list of dependencies inmix.exs
:
def deps do
[
{:supercollider, "~> 0.1.0"}
]
end
- get deps
$ mix deps.get
- compile
$ mix compile
- gen docs with:
$ mix docs
running Supercollider process
first, make sure Supercollider Server it's running:
- Run sclang process or scide.
$ sclang -u 57110 # set 57110 port
- run this lines, to boot the server.
s.options.maxLogins = 8; // set this to allow register for notifications.
s.boot;
- In case you want Elixir to manage the process:
Supercollider.Server.boot()
Start Elixir implementation
- you can use
Supercollider.Server.start_link/1
into children supervisor:
children = [
%{
id: :supercollider_server,
start: {Supercollider.Server, :start_link, []]}
}
]
- alternatively you can run:
Supercollider.Server.start_link([])
- you could also let Elixir spawn Supercollider process:
Supercollider.Server.boot()
- or in a supervisor:
children = [
%{
id: :supercollider_server,
start: {Supercollider.Server, :boot, []]}
}
]
iex(1)> Supercollider.Server.start_link([])
{:ok, #PID<0.239.0>}
iex(2)> Supercollider.Server.version()
%SCVersion{
name: "scsynth",
major: 3,
minor: 12,
patch_name: ".2",
git_branch: "not_a_git_checkout",
hash: "na"
}
iex(3)> Supercollider.Server.status()
%SCStatus{
ugens: 12,
synths: 1,
groups: 9,
synthdefs: 110,
avg_cpu: 0.9217846393585205,
peak_cpu: 0.9244298934936523,
nominal_samplerate: 48000.0,
actual_samplerate: 48000.12624296966
}
iex(4)> Supercollider.Group.query_tree()
%SCGroupQuery{
id: 0,
nodes: [
%SCGroupQuery{id: 469762049, nodes: []},
%SCGroupQuery{id: 402653185, nodes: []},
%SCGroupQuery{id: 335544321, nodes: []},
%SCGroupQuery{id: 268435457, nodes: []},
%SCGroupQuery{id: 201326593, nodes: []},
%SCGroupQuery{id: 134217729, nodes: []},
%SCGroupQuery{id: 67108865, nodes: []},
%SCGroupQuery{id: 1, nodes: []},
%SCSynthQuery{id: 1000, synthdef: "safeClip_2", controls: %{"limit" => 1.0}}
]
}
iex(5)> Supercollider.Server.quit()
:ok
- create documentation
- publish on hex.pmm
Supercollider.Server.boot()
callback- test inside a supervisor
- make tests
- check lacking Server commands
- generate Synthdef with elixir
- make an proof of concept video