feat(sointu-cli): Add ability to adjust HOLD value of the patterns

This commit is contained in:
Veikko Sariola
2020-12-07 11:43:14 +02:00
parent fee637b02a
commit fa163b3884
2 changed files with 29 additions and 0 deletions

View File

@ -27,6 +27,7 @@ func main() {
exactLength := flag.Bool("e", false, "When outputting the C header file, calculate the exact length of song by rendering it once. Only useful when using SPEED opcodes.")
rawOut := flag.Bool("r", false, "Output the rendered song as .raw stereo float32 buffer, to standard output unless otherwise specified.")
directory := flag.String("d", "", "Directory where to output all files. The directory and its parents are created if needed. By default, everything is placed in the same directory where the original song file is.")
hold := flag.Int("o", -1, "New value to be used as the hold value")
flag.Usage = printUsage
flag.Parse()
if flag.NArg() == 0 || *help {
@ -105,6 +106,12 @@ func main() {
return fmt.Errorf("Error playing: %v", err)
}
}
if *hold > -1 {
err = song.UpdateHold(byte(*hold))
if err != nil {
return fmt.Errorf("error updating the hold value of the song: %v", err)
}
}
if *headerOut {
maxSamples := 0 // 0 means it is calculated automatically
if *exactLength {