feat(tracker): implement edit modes, resembling tab stops

This commit is contained in:
vsariola
2021-02-08 20:15:37 +02:00
parent 7408956f77
commit 38008bdb87
13 changed files with 619 additions and 347 deletions

View File

@ -38,6 +38,10 @@ func Encode(patch *sointu.Patch, featureSet FeatureSet) (*EncodedPatch, error) {
}
if unit.Type == "oscillator" && unit.Parameters["type"] == 4 {
s := SampleOffset{Start: uint32(unit.Parameters["samplestart"]), LoopStart: uint16(unit.Parameters["loopstart"]), LoopLength: uint16(unit.Parameters["looplength"])}
if s.LoopLength == 0 {
// hacky quick fix: looplength 0 causes div by zero so avoid crashing
s.LoopLength = 1
}
index, ok := sampleOffsetMap[s]
if !ok {
index = len(c.SampleOffsets)