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