mirror of
https://github.com/vsariola/sointu.git
synced 2026-07-13 14:50:55 -04:00
feat: save only the units and comment to instrument/preset files
This commit is contained in:
parent
f3bb0001cd
commit
4cb9308af3
@@ -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
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- type: envelope
|
||||
id: 1215
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
numvoices: 1
|
||||
units:
|
||||
- id: 90
|
||||
parameters: {}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user