Changeset 73e068d for python/lib/gen_code.py
- Timestamp:
- Aug 20, 2016, 7:24:11 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:
- 1bd8334
- Parents:
- eeb4538
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/lib/gen_code.py
reeb4538 r73e068d 82 82 'tempo': '1', 83 83 'filterbank': 'self->n_filters', 84 'tss': 'self-> hop_size',84 'tss': 'self->buf_size', 85 85 } 86 86 … … 94 94 'tempo': 'self->hop_size', 95 95 'wavetable': 'self->hop_size', 96 'tss': 'self->buf_size / 2 + 1', 96 97 } 97 98 … … 374 375 #print input_params 375 376 #print output_params 377 out += """ 378 PyObject *outputs;""" 376 379 for input_param in input_params: 377 380 out += """ … … 416 419 417 420 {do_fn}(self->o, {inputs}, {c_outputs}); 418 419 return {outputs}; 421 """.format( 422 do_fn = do_fn, 423 inputs = inputs, c_outputs = c_outputs, 424 ) 425 if len(self.do_outputs) > 1: 426 out += """ 427 outputs = PyTuple_New(2);""".format(len(self.do_outputs)) 428 for i, p in enumerate(self.do_outputs): 429 out += """ 430 PyTuple_SetItem( outputs, {i}, self->{p[name]});""".format(i = i, p = p) 431 else: 432 out += """ 433 outputs = self->{p[name]};""".format(p = self.do_outputs[0]) 434 out += """ 435 436 return outputs; 420 437 }} 421 438 """.format( 422 do_fn = do_fn, 423 inputs = inputs, outputs = outputs, c_outputs = c_outputs, 439 outputs = outputs, 424 440 ) 425 441 return out
Note: See TracChangeset
for help on using the changeset viewer.