diff --git a/cmd/sointu-play/main.go b/cmd/sointu-play/main.go index 0bb5761..a075d3b 100644 --- a/cmd/sointu-play/main.go +++ b/cmd/sointu-play/main.go @@ -21,7 +21,6 @@ func main() { help := flag.Bool("h", false, "Show help.") directory := flag.String("o", "", "Directory where to output all files. The directory and its parents are created if needed. By default, everything is placed in the same directory where the original song file is.") play := flag.Bool("p", false, "Play the input songs (default behaviour when no other output is defined).") - unreleased := flag.Bool("u", false, "Start song with all oscillators unreleased.") //start := flag.Float64("start", 0, "Start playing from part; given in the units defined by parameter `unit`.") //stop := flag.Float64("stop", -1, "Stop playing at part; given in the units defined by parameter `unit`. Negative values indicate render until end.") //units := flag.String("unit", "pattern", "Units for parameters start and stop. Possible values: second, sample, pattern, beat. Warning: beat and pattern do not take SPEED modulations into account.") @@ -88,7 +87,7 @@ func main() { return fmt.Errorf("the song could not be parsed as .json (%v) or .yml (%v)", errJSON, errYaml) } } - buffer, err := sointu.Play(bridge.NativeSynther{}, song, !*unreleased) // render the song to calculate its length + buffer, err := sointu.Play(bridge.NativeSynther{}, song) // render the song to calculate its length if err != nil { return fmt.Errorf("sointu.Play failed: %v", err) } diff --git a/synth.go b/synth.go index ce5669f..ae5c8eb 100644 --- a/synth.go +++ b/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) diff --git a/tracker/gioui/files.go b/tracker/gioui/files.go index b211609..50c3442 100644 --- a/tracker/gioui/files.go +++ b/tracker/gioui/files.go @@ -140,7 +140,7 @@ func (t *Tracker) saveSong(w io.WriteCloser) bool { } func (t *Tracker) exportWav(w io.WriteCloser, pcm16 bool) { - data, err := sointu.Play(t.synther, t.Song(), true) // render the song to calculate its length + data, err := sointu.Play(t.synther, t.Song()) // render the song to calculate its length if err != nil { t.Alert.Update(fmt.Sprintf("Error rendering the song during export: %v", err), Error, time.Second*3) return diff --git a/vm/compiler/bridge/native_synth_test.go b/vm/compiler/bridge/native_synth_test.go index 5654b32..189e9b0 100644 --- a/vm/compiler/bridge/native_synth_test.go +++ b/vm/compiler/bridge/native_synth_test.go @@ -40,7 +40,7 @@ func TestOscillatSine(t *testing.T) { }}} tracks := []sointu.Track{{NumVoices: 1, Order: []int{0}, Patterns: []sointu.Pattern{{64, 0, 68, 0, 32, 0, 0, 0, 75, 0, 78, 0, 0, 0, 0, 0}}}} song := sointu.Song{BPM: 100, RowsPerBeat: 4, Score: sointu.Score{RowsPerPattern: 16, Length: 1, Tracks: tracks}, Patch: patch} - buffer, err := sointu.Play(bridge.NativeSynther{}, song, false) + buffer, err := sointu.Play(bridge.NativeSynther{}, song) if err != nil { t.Fatalf("Render failed: %v", err) } @@ -95,7 +95,7 @@ func TestAllRegressionTests(t *testing.T) { if err != nil { t.Fatalf("could not parse the .yml file: %v", err) } - buffer, err := sointu.Play(bridge.NativeSynther{}, song, false) + buffer, err := sointu.Play(bridge.NativeSynther{}, song) buffer = buffer[:song.Score.LengthInRows()*song.SamplesPerRow()] // extend to the nominal length always. if err != nil { t.Fatalf("Play failed: %v", err) diff --git a/vm/go_synth_test.go b/vm/go_synth_test.go index 1dece5a..1c46bdf 100644 --- a/vm/go_synth_test.go +++ b/vm/go_synth_test.go @@ -43,7 +43,7 @@ func TestAllRegressionTests(t *testing.T) { if err != nil { t.Fatalf("could not parse the .yml file: %v", err) } - buffer, err := sointu.Play(vm.GoSynther{}, song, false) + buffer, err := sointu.Play(vm.GoSynther{}, song) buffer = buffer[:song.Score.LengthInRows()*song.SamplesPerRow()] // extend to the nominal length always. if err != nil { t.Fatalf("Play failed: %v", err)