mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-23 07:24:47 -04:00
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:
@ -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
|
||||
|
@ -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))
|
||||
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user