mirror of
https://github.com/vsariola/sointu.git
synced 2026-04-12 17:14:43 -04:00
drafting increasing maximum voice numbers to 256
This commit is contained in:
parent
ac218e7e54
commit
44ee37882b
@ -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
|
||||
|
||||
Reference in New Issue
Block a user