mirror of
https://github.com/vsariola/sointu.git
synced 2025-07-18 21:14:31 -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:
12
patch.go
12
patch.go
@ -37,6 +37,18 @@ func (p Patch) NumDelayLines() int {
|
||||
return total
|
||||
}
|
||||
|
||||
func (p Patch) NumSyncs() int {
|
||||
total := 0
|
||||
for _, instr := range p {
|
||||
for _, unit := range instr.Units {
|
||||
if unit.Type == "sync" {
|
||||
total += instr.NumVoices
|
||||
}
|
||||
}
|
||||
}
|
||||
return total
|
||||
}
|
||||
|
||||
func (p Patch) FirstVoiceForInstrument(instrIndex int) int {
|
||||
ret := 0
|
||||
for _, t := range p[:instrIndex] {
|
||||
|
Reference in New Issue
Block a user