-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
31 lines (23 loc) · 779 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package main
import (
"sync"
"github.com/crnbaker/gostringsynth/audioengine"
"github.com/crnbaker/gostringsynth/gui"
"github.com/crnbaker/gostringsynth/notes"
"github.com/crnbaker/gostringsynth/sources"
)
const sampleRate = 44100
const voiceLimit = 6
func main() {
var wg sync.WaitGroup
wg.Add(4)
voiceChan := make(chan audioengine.SynthVoice)
noteChan := make(chan sources.StringNote)
pluckPlotChan := make(chan []float64)
userSettingsChannel := make(chan gui.SynthParameters)
go gui.StartUILoop(&wg, pluckPlotChan, userSettingsChannel)
go audioengine.ControlVoices(&wg, voiceChan, sampleRate, voiceLimit)
go sources.PublishVoices(&wg, noteChan, voiceChan, pluckPlotChan, sampleRate)
go notes.PublishNotes(&wg, noteChan, userSettingsChannel)
wg.Wait()
}