feat(sointu, tracker,...): restructure domain & tracker models

send targets are now by ID and Song has "Score" part, which is the notes for it. also, moved the model part separate of the actual gioui dependend stuff.

sorry to my future self about the code bomb; ended up too far and did not find an easy way to rewrite the history to make the steps smaller, so in the end, just squashed everything.
This commit is contained in:
vsariola
2021-02-23 23:55:42 +02:00
parent fd1d018e82
commit adcf3ebce8
155 changed files with 5520 additions and 4914 deletions

View File

@ -40,7 +40,7 @@ su_render_sampleloop: ; loop through every sample in the row
{{- if .SupportsPolyphony}}
{{.Push (.PolyphonyBitmask | printf "%v") "PolyphonyBitmask"}} ; does the next voice reuse the current opcodes?
{{- end}}
{{.Push (.Song.Patch.TotalVoices | printf "%v") "VoicesRemain"}}
{{.Push (.Song.Patch.NumVoices | printf "%v") "VoicesRemain"}}
mov {{.DX}}, {{.PTRWORD}} su_synth_obj ; {{.DX}} points to the synth object
mov {{.COM}}, {{.PTRWORD}} su_patch_code ; COM points to vm code
mov {{.VAL}}, {{.PTRWORD}} su_patch_parameters ; VAL points to unit params
@ -140,7 +140,7 @@ su_update_voices_nexttrack:
pop {{.DX}} ; edx=patrnrow
add {{.SI}}, {{.SequenceLength}}
inc {{.BP}}
{{- $addrname := len .Song.Tracks | printf "su_synth_obj + %v"}}
{{- $addrname := len .Song.Score.Tracks | printf "su_synth_obj + %v"}}
{{- .Prepare $addrname | indent 8}}
cmp {{.BP}},{{.Use $addrname}}
jl su_update_voices_trackloop
@ -154,7 +154,7 @@ su_update_voices_nexttrack:
{{- .Prepare "su_tracks" | indent 4}}
lea {{.SI}}, [{{.Use "su_tracks"}}+{{.AX}}]; esi points to the pattern data for current track
mov {{.DI}}, {{.PTRWORD}} su_synth_obj+su_synthworkspace.voices
mov bl, {{len .Song.Tracks}} ; MAX_TRACKS is always <= 32 so this is ok
mov bl, {{len .Song.Score.Tracks}} ; MAX_TRACKS is always <= 32 so this is ok
su_update_voices_trackloop:
movzx eax, byte [{{.SI}}] ; eax = current pattern
imul eax, {{.PatternLength}} ; multiply by rows per pattern, eax = offset to current pattern data

View File

@ -8,8 +8,8 @@
#define SU_SAMPLE_RATE 44100
#define SU_BPM {{.Song.BPM}}
#define SU_ROWS_PER_BEAT {{.Song.RowsPerBeat}}
#define SU_PATTERN_SIZE {{.Song.RowsPerPattern}}
#define SU_MAX_PATTERNS {{.Song.SequenceLength}}
#define SU_PATTERN_SIZE {{.Song.Score.RowsPerPattern}}
#define SU_MAX_PATTERNS {{.Song.Score.Length}}
#define SU_TOTAL_ROWS (SU_MAX_PATTERNS*SU_PATTERN_SIZE)
#define SU_SAMPLES_PER_ROW (SU_SAMPLE_RATE*60/(SU_BPM*SU_ROWS_PER_BEAT))

View File

@ -89,7 +89,7 @@ su_op_aux_mono:
{{.Func "su_op_send" "Opcode"}}
lodsw
mov {{.CX}}, [{{.Stack "Voice"}}] ; load pointer to voice
{{- if .SupportsParamValueOtherThan "send" "voice" 0}}
{{- if .SupportsGlobalSend}}
pushf ; uh ugly: we save the flags just for the stereo carry bit. Doing the .CX loading later crashed the synth for stereo sends as loading the synth address from stack was f'd up by the "call su_op_send_mono"
test {{.AX}}, 0x8000
jz su_op_send_skipglobal