shithub: aubio

Download patch

ref: 5c246b0fccc89e2866cd3ac1327a65d139754ffa
parent: 7c4cf2086fe40331636fc29b8b0145da9f6e9c60
author: Paul Brossier <piem@piem.org>
date: Thu Nov 5 20:25:13 EST 2009

gen_pyobject.py: update, add smpl_t

--- a/interfaces/python/gen_pyobject.py
+++ b/interfaces/python/gen_pyobject.py
@@ -29,7 +29,7 @@
 # move into the C library at some point.
 defaultsizes = {
     'resampler':    ('input->length * self->ratio', 'input->channels'),
-    'onsetdetection': ('1', 'self->channels'),
+    'specdesc':     ('1', 'self->channels'),
     'onset':        ('1', 'self->channels'),
     'pitchyin':     ('1', 'in->channels'),
     'pitchyinfft':  ('1', 'in->channels'),
@@ -37,9 +37,9 @@
     'pitchmcomb':   ('1', 'self->channels'),
     'pitchfcomb':   ('1', 'self->channels'),
     'pitch':        ('1', 'self->channels'),
-    'tss':          ('self->hop_s', 'self->channels'),
+    'tss':          ('self->hop_size', 'self->channels'),
     'mfcc':         ('self->n_coeffs', 'in->channels'),
-    'beattracking': ('self->winlen', 'self->channels'),
+    'beattracking': ('self->hop_size', 'self->channels'),
     'tempo':        ('1', 'self->channels'),
     'peakpicker':   ('1', 'self->channels'),
 }
@@ -54,13 +54,8 @@
 
 aubiodefvalue = {
     # we have some clean up to do
-    'win_s': 'Py_default_vector_length', 
-    'bufsize': 'Py_default_vector_length', 
     'buf_size': 'Py_default_vector_length', 
-    'winlen': 'Py_default_vector_length', 
     # and here too
-    'hop_s': 'Py_default_vector_length / 2', 
-    'hopsize': 'Py_default_vector_length / 2', 
     'hop_size': 'Py_default_vector_length / 2', 
     # these should be alright
     'channels': 'Py_default_vector_channels', 
@@ -75,10 +70,7 @@
     'ihig': '1.', 
     'thrs': '0.5',
     'ratio': '0.5',
-    'threshold': '0.5',
-    'mode': '"default"',
-    'onset_mode': '"default"',
-    'type': '0',
+    'method': '"default"',
     }
 
 # aubio to python
@@ -306,6 +298,10 @@
         elif param[0] == 'uint_t':
             s += """
   {"%(pname)s", T_INT, offsetof (Py_%(name)s, %(pname)s), READONLY, ""},""" \
+        % { 'pname': param[1], 'ptype': param[0], 'name': name}
+        elif param[0] == 'smpl_t':
+            s += """
+  {"%(pname)s", T_FLOAT, offsetof (Py_%(name)s, %(pname)s), READONLY, ""},""" \
         % { 'pname': param[1], 'ptype': param[0], 'name': name}
         else:
             print "-- ERROR, unknown member type ", param