possible to disable wasm render on start

This commit is contained in:
Peter Salomonsen 2023-04-05 18:57:42 +00:00
parent c429178758
commit 53a8429a69
4 changed files with 11 additions and 6 deletions

11
song.go
View File

@ -11,11 +11,12 @@ import (
// playback speed, but this could be changed to a floating point in future if
// finer adjustments are necessary.
type Song struct {
BPM int
RowsPerBeat int
Score Score
Patch Patch
CreateEmptyPatterns bool
BPM int
RowsPerBeat int
Score Score
Patch Patch
CreateEmptyPatterns bool
WasmDisableRenderOnStart bool
}
// Copy makes a deep copy of a Score.

View File

@ -880,7 +880,9 @@
(export "render_128_samples" (func $render_128_samples))
(export "update_voices" (func $su_update_voices))
{{- if .RenderOnStart }}
(start $render) ;; we run render automagically when the module is instantiated
{{- end}}
(func $render (param)
{{- if .Output16Bit }} (local $channel i32) {{- end }}

View File

@ -1,6 +1,7 @@
bpm: 120
rowsperbeat: 4
createemptypatterns: true
wasmdisablerenderonstart: false
score:
length: 1
rowsperpattern: 16

View File

@ -126,7 +126,8 @@ func (com *Compiler) Song(song *sointu.Song) (map[string]string, error) {
PatternLength int
SequenceLength int
Hold int
}{compilerMacros, featureSetMacros, wasmMacros, songMacros, encodedPatch, patterns, sequences, len(patterns[0]), len(sequences[0]), 1}
RenderOnStart bool
}{compilerMacros, featureSetMacros, wasmMacros, songMacros, encodedPatch, patterns, sequences, len(patterns[0]), len(sequences[0]), 1, !song.WasmDisableRenderOnStart}
populatedTemplate, extension, err = com.compile(templateName, &data)
}
if err != nil {