drafting increasing maximum voice numbers to 256

This commit is contained in:
5684185+vsariola@users.noreply.github.com
2026-04-04 02:41:34 +03:00
parent ac218e7e54
commit 44ee37882b
18 changed files with 821 additions and 43 deletions

View File

@ -6,7 +6,8 @@ import (
type SongMacros struct {
Song *sointu.Song
VoiceTrackBitmask int
VoiceTrackBitmask []byte
HasVoiceTrack bool
MaxSamples int
}
@ -14,9 +15,13 @@ func NewSongMacros(s *sointu.Song) *SongMacros {
maxSamples := s.SamplesPerRow() * s.Score.LengthInRows()
p := SongMacros{Song: s, MaxSamples: maxSamples}
trackVoiceNumber := 0
p.VoiceTrackBitmask = make([]byte, (s.Score.NumVoices()+7)/8)
for _, t := range s.Score.Tracks {
if t.NumVoices > 0 {
p.HasVoiceTrack = true
}
for b := 0; b < t.NumVoices-1; b++ {
p.VoiceTrackBitmask += 1 << trackVoiceNumber
p.VoiceTrackBitmask[trackVoiceNumber/8] += 1 << (trackVoiceNumber % 8)
trackVoiceNumber++
}
trackVoiceNumber++ // set all bits except last one