Changeset bf54364 for python/lib
- Timestamp:
- Jul 12, 2016, 8:17:12 PM (8 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- c395732
- Parents:
- 34e753c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/lib/gen_code.py
r34e753c rbf54364 85 85 } 86 86 87 objinputsize = { 88 'mfcc': 'self->buf_size / 2 + 1', 89 'notes': 'self->hop_size', 90 'onset': 'self->hop_size', 91 'pitch': 'self->hop_size', 92 'sampler': 'self->hop_size', 93 'specdesc': 'self->buf_size / 2 + 1', 94 'tempo': 'self->hop_size', 95 'wavetable': 'self->hop_size', 96 } 97 87 98 def get_name(proto): 88 99 name = proto.replace(' *', '* ').split()[1].split('(')[0] … … 378 389 return NULL; 379 390 }}""".format(input_param, pytoaubio = pytoaubio_fn[input_param['type']]) 380 out += """ 391 if self.shortname in objinputsize: 392 out += """ 393 394 if (self->{0[name]}.length != {expected_size}) {{ 395 PyErr_Format (PyExc_ValueError, 396 "input size of {shortname} should be %d, not %d", 397 {expected_size}, self->{0[name]}.length); 398 return NULL; 399 }}""".format(input_param, expected_size = objinputsize[self.shortname], **self.__dict__) 400 else: 401 out += """ 381 402 382 403 // TODO: check input sizes"""
Note: See TracChangeset
for help on using the changeset viewer.