History

python/lib/gen_code.py: add pitchshift

Paul Brossier committed 10 years ago

Commit af241391 parent f6c4c1c1 file · +13 −1Browse files

Showing the changes to python (1 of 1 file). Show all

Unified · Split

python/lib/gen_code.py+13−1
@@ -19,6 +19,7 @@ aubiodefvalue = { · 18 unmodified lines
19 'ratio': '0.5',19 'ratio': '0.5',
20 'method': '"default"',20 'method': '"default"',
21 'uri': '"none"',21 'uri': '"none"',
22 'pitchscale': '1.',
22 }23 }
23 24
24member_types = {25member_types = {
@@ -82,6 +83,7 @@ objoutsize = { · 57 unmodified lines
82 'tempo': '1',83 'tempo': '1',
83 'filterbank': 'self->n_filters',84 'filterbank': 'self->n_filters',
84 'tss': 'self->buf_size',85 'tss': 'self->buf_size',
86 'pitchshift': 'self->hop_size',
85 }87 }
86 88
87objinputsize = {89objinputsize = {
@@ -94,6 +96,7 @@ objinputsize = { · 6 unmodified lines
94 'tempo': 'self->hop_size',96 'tempo': 'self->hop_size',
95 'wavetable': 'self->hop_size',97 'wavetable': 'self->hop_size',
96 'tss': 'self->buf_size / 2 + 1',98 'tss': 'self->buf_size / 2 + 1',
99 'pitchshift': 'self->hop_size',
97 }100 }
98 101
99def get_name(proto):102def get_name(proto):
@@ -265,6 +268,8 @@ Py_{shortname}_new (PyTypeObject * pytype, PyObject * args, PyObject * kwds) · 165 unmodified lines
265 return self.check_valid_uint(p)268 return self.check_valid_uint(p)
266 if p['type'] == 'char_t*':269 if p['type'] == 'char_t*':
267 return self.check_valid_char(p)270 return self.check_valid_char(p)
271 if p['type'] == 'smpl_t':
272 return self.check_valid_smpl(p)
268 else:273 else:
269 print ("ERROR, no idea how to check %s for validity" % p['type'])274 print ("ERROR, no idea how to check %s for validity" % p['type'])
270 275
@@ -284,7 +289,14 @@ Py_{shortname}_new (PyTypeObject * pytype, PyObject * args, PyObject * kwds) · 13 unmodified lines
284 name = p['name']289 name = p['name']
285 return """290 return """
286 self->{name} = {defval};291 self->{name} = {defval};
287 if ({name} != NULL) {{292""".format(defval = aubiodefvalue[name], name = name)
293
294 def check_valid_smpl(self, p):
295 name = p['name']
296 return """
297 self->{name} = {defval};
298 // nothing to do?
299 if ({name} != {defval}) {{
288 self->{name} = {name};300 self->{name} = {name};
289 }}301 }}
290""".format(defval = aubiodefvalue[name], name = name)302""".format(defval = aubiodefvalue[name], name = name)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t