mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-19 05:24:48 -04:00
feat: add the ability to use Sointu as a sync-tracker
There is a new "sync" opcode that saves the top-most signal every 256 samples to the new "syncBuffer" output. Additionally, you can enable saving the current fractional row as sync[0], avoiding calculating the beat in the shader, but also calculating the beat correctly when the beat is modulated.
This commit is contained in:
@ -21,3 +21,24 @@
|
||||
fstp dword [{{.WRK}}] ; save the remainder for future
|
||||
ret
|
||||
{{end}}
|
||||
|
||||
|
||||
{{- if or .RowSync (.HasOp "sync")}}
|
||||
;-------------------------------------------------------------------------------
|
||||
; SYNC opcode: save the stack top to sync buffer
|
||||
;-------------------------------------------------------------------------------
|
||||
{{.Func "su_op_sync" "Opcode"}}
|
||||
{{- if not .Library}}
|
||||
; TODO: syncs are NOPs when compiling as library, should figure out a way to
|
||||
; make them work when compiling to use the native track also
|
||||
mov {{.AX}}, [{{.Stack "GlobalTick"}}]
|
||||
test al, al
|
||||
jne su_op_sync_skip
|
||||
xchg {{.AX}}, [{{.Stack "SyncBufPtr"}}]
|
||||
fst dword [{{.AX}}]
|
||||
add {{.AX}}, 4
|
||||
xchg {{.AX}}, [{{.Stack "SyncBufPtr"}}]
|
||||
su_op_sync_skip:
|
||||
{{- end}}
|
||||
ret
|
||||
{{end}}
|
||||
|
Reference in New Issue
Block a user