- Portaudio
$ go get ./...
$ go run main.go
Note: if the application panics with a message related to an invalid number of channels, you can try adjusting the devices used by portaudio. I will implement proper device detection with the next releases.
The synthesizer is controllable via a GraphQL API running on http://localhost:8080/synth
.
query {
Mixer {
Channels {
Pan {
Value
}
Volume {
Value
}
}
}
}
mutation {
Mixer {
Channel(Idx: 0) {
Volume {
Set(Value: 1)
}
Pan {
Set(Value: -1)
}
}
}
}
Note: For now, WebSynth only supports the oscillator module. This will obviously improve in the next releases.
query {
Modules {
List {
... on Oscillator {
Frequency {
Value
}
Volume {
Value
}
}
}
}
}
mutation {
Modules {
Create {
Oscillator
}
}
}
mutation {
Mixer {
Channel(Idx: 0) {
Input {
Attach(ModuleIdx: 0, ModuleField: "Sine")
}
}
}
}
mutation {
Mixer {
Channel(Idx: 0) {
Input {
Detach
}
}
}
}
Note: This obviously assumes that module 0 is an oscillator.
mutation {
Module(Idx: 0) {
...on OscillatorMutation {
Frequency {
Set(Value: 200)
}
}
}
}