sforkowany z mirror/rnsutils
Change comment storage
rodzic
d047888eee
commit
04ef45597a
|
@ -171,6 +171,19 @@ class RenoiseInstrument(object):
|
|||
def name(self, value):
|
||||
self.root.Name = value
|
||||
|
||||
@property
|
||||
def comment(self):
|
||||
return "\n".join(self.root.GlobalProperties.Comments.Comment)
|
||||
|
||||
@comment.setter
|
||||
def comment(self, value):
|
||||
E = objectify.E
|
||||
|
||||
if 'Comments' not in self.root.GlobalProperties.getchildren():
|
||||
self.root.GlobalProperties.Comments = E.Comments()
|
||||
|
||||
self.root.GlobalProperties.Comments.Comment = [E.Comment(line) for line in value.split("\n")]
|
||||
|
||||
def cleanup(self):
|
||||
# ensure that key mapping remains in the limits of what renoise supports
|
||||
for sample in self.root.SampleGenerator.Samples.Sample:
|
||||
|
|
|
@ -127,9 +127,10 @@ class Sf2ToXrni(object):
|
|||
def convert_instrument(self, sf2_instrument, renoise_instrument):
|
||||
# convert instrument meta data
|
||||
renoise_instrument.name = sf2_instrument.name
|
||||
renoise_instrument.root.Comments = "Converted from instrument {} with sf2toxrni " \
|
||||
"( https://gitlab.com/zeograd/rnsutils )" \
|
||||
"\n---\n{}".format(sf2_instrument.name, sf2_instrument.parent.info)
|
||||
|
||||
renoise_instrument.comment = "Converted from instrument {} with sf2toxrni " \
|
||||
"( https://gitlab.com/zeograd/rnsutils )" \
|
||||
"\n---\n{}".format(sf2_instrument.name, sf2_instrument.parent.info)
|
||||
|
||||
# load global properties if any
|
||||
renoise_global_sample = deepcopy(renoise_instrument.sample_template)
|
||||
|
|
|
@ -97,8 +97,8 @@ class SfzToXrni(object):
|
|||
renoise_instrument.root.find('GlobalProperties/*[Name="SF2 chorus"]').Value = 0
|
||||
renoise_instrument.root.SampleGenerator.KeyzoneOverlappingMode = RenoiseInstrument.OVERLAP_ALL
|
||||
|
||||
renoise_instrument.root.Comments = "Converted from SFZ {} with sfztoxrni " \
|
||||
"( https://gitlab.com/zeograd/rnsutils )".format(sfz_filename)
|
||||
renoise_instrument.comment = "Converted from SFZ {} with sfztoxrni " \
|
||||
"( https://gitlab.com/zeograd/rnsutils )".format(sfz_filename)
|
||||
|
||||
with open(sfz_filename, 'rt') as sfz_file:
|
||||
# convert instrument meta data
|
||||
|
|
Ładowanie…
Reference in New Issue