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
1919 'ratio': '0.5',
2020 'method': '"default"',
2121 'uri': '"none"',
22+ 'pitchscale': '1.',
2223 }
2324
2425 member_types = {
@@ -82,6 +83,7 @@ objoutsize = { · 57 unmodified lines
8283 'tempo': '1',
8384 'filterbank': 'self->n_filters',
8485 'tss': 'self->buf_size',
86+ 'pitchshift': 'self->hop_size',
8587 }
8688
8789 objinputsize = {
@@ -94,6 +96,7 @@ objinputsize = { · 6 unmodified lines
9496 'tempo': 'self->hop_size',
9597 'wavetable': 'self->hop_size',
9698 'tss': 'self->buf_size / 2 + 1',
99+ 'pitchshift': 'self->hop_size',
97100 }
98101
99102 def get_name(proto):
@@ -265,6 +268,8 @@ Py_{shortname}_new (PyTypeObject * pytype, PyObject * args, PyObject * kwds) · 165 unmodified lines
265268 return self.check_valid_uint(p)
266269 if p['type'] == 'char_t*':
267270 return self.check_valid_char(p)
271+ if p['type'] == 'smpl_t':
272+ return self.check_valid_smpl(p)
268273 else:
269274 print ("ERROR, no idea how to check %s for validity" % p['type'])
270275
@@ -284,7 +289,14 @@ Py_{shortname}_new (PyTypeObject * pytype, PyObject * args, PyObject * kwds) · 13 unmodified lines
284289 name = p['name']
285290 return """
286291 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}) {{
288300 self->{name} = {name};
289301 }}
290302 """.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