mirror of
https://github.com/vsariola/sointu.git
synced 2026-04-12 17:14:43 -04:00
feat: save only the units and comment to instrument/preset files
This commit is contained in:
parent
f3bb0001cd
commit
4cb9308af3
@ -45,6 +45,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
did not, resulting it claiming errors in patches that worked once compiled.
|
||||
|
||||
### Changed
|
||||
- Save only units and comment to instrument files, as we keep all the other
|
||||
fields while loading a new instrument / preset and the name comes from the
|
||||
filename.
|
||||
- Recovery files were moved to `os.UserConfigDir()/sointu/recovery/` instead of
|
||||
`os.UserConfigDir()/sointu/` so that they don't pollute the main configuration
|
||||
directory and so that it's easy to delete just the recovery files.
|
||||
|
||||
2
patch.go
2
patch.go
@ -21,7 +21,7 @@ type (
|
||||
Instrument struct {
|
||||
Name string `yaml:",omitempty"`
|
||||
Comment string `yaml:",omitempty"`
|
||||
NumVoices int
|
||||
NumVoices int `yaml:",omitempty"`
|
||||
Mute bool `yaml:",omitempty"` // Mute is only used in the tracker for soloing/muting instruments; the compiled player ignores this field
|
||||
// ThreadMaskM1 is a bit mask of which threads are used, minus 1. Minus
|
||||
// 1 is done so that the default value 0 means bit mask 0b0001 i.e. only
|
||||
|
||||
@ -32,9 +32,11 @@ func main() {
|
||||
return nil
|
||||
}
|
||||
tracker.RemoveUnusedUnitParameters(&instr) // remove invalid parameters
|
||||
instr.Name = "" // we don't need the names in the preset files as they are derived from the file path
|
||||
instr.NumVoices = 1
|
||||
outData, err := yaml.Marshal(instr)
|
||||
instr2 := sointu.Instrument{ // keep only the relevant fields
|
||||
Comment: instr.Comment,
|
||||
Units: instr.Units,
|
||||
}
|
||||
outData, err := yaml.Marshal(instr2)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "could not marshal the preset file %v: %v\n", path, err)
|
||||
return nil
|
||||
|
||||
@ -408,13 +408,18 @@ func (m *InstrModel) Write(w io.WriteCloser) bool {
|
||||
var contents []byte
|
||||
var err error
|
||||
instr := m.d.Song.Patch[m.d.InstrIndex]
|
||||
instr2 := sointu.Instrument{ // save only the relevant fields
|
||||
Name: instr.Name,
|
||||
Comment: instr.Comment,
|
||||
Units: instr.Units,
|
||||
}
|
||||
if _, ok := w.(*os.File); ok {
|
||||
instr.Name = "" // don't save the instrument name to a file; we'll replace the instruments name with the filename when loading from a file
|
||||
instr2.Name = "" // don't save the instrument name to a file; we'll replace the instruments name with the filename when loading from a file
|
||||
}
|
||||
if extension == ".json" {
|
||||
contents, err = json.Marshal(instr)
|
||||
contents, err = json.Marshal(instr2)
|
||||
} else {
|
||||
contents, err = yaml.Marshal(instr)
|
||||
contents, err = yaml.Marshal(instr2)
|
||||
}
|
||||
if err != nil {
|
||||
(*Model)(m).Alerts().Add(fmt.Sprintf("Error marshaling an instrument file: %v", err), Error)
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: oscillator
|
||||
id: 3
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: oscillator
|
||||
id: 3
|
||||
|
||||
@ -8,7 +8,6 @@ comment: |
|
||||
Filter 1: High pass filter to remove the low end.
|
||||
Filter 2: Low pass filter, with the frequency modulated by the Send (starts high and drops low, for that snap).
|
||||
Envelope-distort-send: Make the filter 2 frequency drop quickly from high to low, for the "snap".
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 217
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 2
|
||||
units:
|
||||
- id: 2064
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 2
|
||||
units:
|
||||
- id: 218
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 1545
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 1546
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 184
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 160
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: oscillator
|
||||
id: 1983
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 2
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1974
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 217
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 2
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1821
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 2
|
||||
units:
|
||||
- id: 235
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 68
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 208
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 2
|
||||
units:
|
||||
- type: envelope
|
||||
id: 2277
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 2
|
||||
units:
|
||||
- id: 216
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 2
|
||||
units:
|
||||
- id: 1241
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 1351
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 2
|
||||
units:
|
||||
- id: 1351
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 2
|
||||
units:
|
||||
- id: 2041
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 1296
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 1005
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 1011
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 1005
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 2
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1209
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 1234
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 2
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1241
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 1280
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 1280
|
||||
parameters: {}
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
comment: |-
|
||||
Generic pluck generator
|
||||
Use oscillator type, color and shape to alter the sound properties
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 1713
|
||||
parameters: {}
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
comment: |-
|
||||
Generic pluck generator
|
||||
Use oscillator type, color and shape to alter the sound properties
|
||||
numvoices: 2
|
||||
units:
|
||||
- id: 1007
|
||||
parameters: {}
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
comment: |-
|
||||
Generic pluck generator
|
||||
Use oscillator type, color and shape to alter the sound properties
|
||||
numvoices: 2
|
||||
units:
|
||||
- id: 1713
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 81
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 23
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 23
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 52
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1215
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1215
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 14
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1215
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1215
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
comment: Use range C-4 to G-4
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1217
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
name: DR kick-edm
|
||||
comment: A#2
|
||||
numvoices: 2
|
||||
units:
|
||||
- id: 128
|
||||
parameters: {}
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
name: DR kickedm2
|
||||
comment: A#2
|
||||
numvoices: 2
|
||||
units:
|
||||
- id: 1660
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1
|
||||
|
||||
@ -2,7 +2,6 @@ comment: |
|
||||
Closed hihat: Atk 8 + Dec 60
|
||||
Open hihat: Atk8 + Dec75
|
||||
Shaker: Atk55 + Dec60
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 333
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 1215
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1044
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1078
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1215
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
comment: 'Suggested note: C-3'
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 296
|
||||
parameters: {}
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
comment: 'Suggested note: C-3'
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 296
|
||||
parameters: {}
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
comment: 'Suggested note: C-3'
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 336
|
||||
parameters: {}
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
comment: 'Suggested note: C-3'
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 339
|
||||
parameters: {}
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
comment: 'Suggested note: C-3'
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 285
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 33
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1217
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
comment: A#2
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 128
|
||||
parameters: {}
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
comment: A#2
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 130
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1036
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1217
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 3021
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1217
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
comment: 'suggested note: D-4'
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 334
|
||||
parameters: {}
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
comment: 'suggested note: E-4'
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 340
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1217
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1
|
||||
|
||||
@ -10,7 +10,6 @@ comment: |
|
||||
Delay: Add some reverb to make it sound little less synthetic. Used the exact same coefficients as the main reverb, so they appear in the final .asm only once.
|
||||
Compressor: Tame the transient, boost the tail.
|
||||
Envelope-distort-send: Quickly drop the pitch of the tom from high to neutral.
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 31
|
||||
parameters: {}
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
comment: 'Suggested range: E-4'
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 241
|
||||
parameters: {}
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
comment: 'Suggested range: E-4'
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 339
|
||||
parameters: {}
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
comment: 'Suggested range: E-4'
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 341
|
||||
parameters: {}
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
comment: 'Suggested range: E-2 to C-3'
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 311
|
||||
parameters: {}
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
comment: 'Suggested range: E-2 to C-3'
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 217
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1217
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1217
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1217
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 1752
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1733
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1718
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 92
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 87
|
||||
parameters: {}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1974
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1993
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user