Changes in python/lib/gen_code.py [1164fd85:bf54364]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/lib/gen_code.py
r1164fd85 rbf54364 75 75 'onset': '1', 76 76 'pitch': '1', 77 'notes': '3', 77 78 'wavetable': 'self->hop_size', 78 79 'sampler': 'self->hop_size', … … 82 83 'filterbank': 'self->n_filters', 83 84 'tss': 'self->hop_size', 85 } 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', 84 96 } 85 97 … … 377 389 return NULL; 378 390 }}""".format(input_param, pytoaubio = pytoaubio_fn[input_param['type']]) 379 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 += """ 380 402 381 403 // TODO: check input sizes"""
Note: See TracChangeset
for help on using the changeset viewer.