fix: do not include delay times from disabled delay units

Closes #139.
This commit is contained in:
5684185+vsariola@users.noreply.github.com 2024-08-14 15:40:32 +03:00
parent 2667c3c72c
commit 75bd9c591e
2 changed files with 10 additions and 3 deletions

View File

@ -3,6 +3,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## Unreleased
### Fixed
- Do not include delay times in the delay time table if the delay unit is
disabled ([#139][i139])
## v0.4.0
### Added
- User can drop preset instruments into `os.UserConfigDir()/sointu/presets/` and
@ -167,3 +172,4 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
[i128]: https://github.com/vsariola/sointu/issues/128
[i129]: https://github.com/vsariola/sointu/issues/129
[i130]: https://github.com/vsariola/sointu/issues/130
[i139]: https://github.com/vsariola/sointu/issues/139

View File

@ -115,9 +115,10 @@ func constructDelayTimeTable(patch sointu.Patch, bpm int) ([]int, [][]int) {
for i, instr := range patch {
ind[i] = make([]int, len(instr.Units))
for j, unit := range instr.Units {
// only include delay times for delays. Only delays
// should use delay times
if unit.Type == "delay" {
// only include delay times for delays. Only delays should use delay
// times. Only delay times for enabled delay units should be in the
// table.
if unit.Type == "delay" && !unit.Disabled {
ind[i][j] = len(subarrays)
converted := make([]int, len(unit.VarArgs))
copy(converted, unit.VarArgs)