sforkowany z mirror/rnsutils
1
0
Forkuj 0

Change comment storage

master
Olivier Jolly 2016-02-02 00:08:58 +01:00
rodzic d047888eee
commit 04ef45597a
3 zmienionych plików z 19 dodań i 5 usunięć

Wyświetl plik

@ -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:

Wyświetl plik

@ -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)

Wyświetl plik

@ -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