mirror of
https://github.com/vsariola/sointu.git
synced 2026-02-15 20:53:17 -05:00
feat: remove unreleased parameter from Play function
The VMs now release all envelopes by default, so this mechanism was useless / did not actually start them as unreleased even when you thought they did.
This commit is contained in:
parent
9f7bbce761
commit
b6815f70cb
13
synth.go
13
synth.go
@ -54,12 +54,8 @@ func Render(synth Synth, buffer AudioBuffer) error {
|
||||
}
|
||||
|
||||
// Play plays the Song by first compiling the patch with the given Synther,
|
||||
// returning the stereo audio buffer and the sync buffer as a result (and
|
||||
// possible errors). Passing 'release' as true means that all the notes are
|
||||
// released when the synth is created. The default behaviour during runtime
|
||||
// rendering is to leave them playing, meaning that envelopes start attacking
|
||||
// right away unless an explicit note release is put to every track.
|
||||
func Play(synther Synther, song Song, release bool) (AudioBuffer, error) {
|
||||
// returning the stereo audio buffer as a result (and possible errors).
|
||||
func Play(synther Synther, song Song) (AudioBuffer, error) {
|
||||
err := song.Validate()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -68,11 +64,6 @@ func Play(synther Synther, song Song, release bool) (AudioBuffer, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("sointu.Play failed: %v", err)
|
||||
}
|
||||
if release {
|
||||
for i := 0; i < 32; i++ {
|
||||
synth.Release(i)
|
||||
}
|
||||
}
|
||||
curVoices := make([]int, len(song.Score.Tracks))
|
||||
for i := range curVoices {
|
||||
curVoices[i] = song.Score.FirstVoiceForTrack(i)
|
||||
|
||||
Reference in New Issue
Block a user