Changeset af24139


Ignore:
Timestamp:
Sep 17, 2016, 1:45:22 AM (8 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/cnn, feature/crepe, feature/pitchshift, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch
Children:
0015a54
Parents:
f6c4c1c
Message:

python/lib/gen_code.py: add pitchshift

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/lib/gen_code.py

    rf6c4c1c raf24139  
    2020    'method': '"default"',
    2121    'uri': '"none"',
     22    'pitchscale': '1.',
    2223    }
    2324
     
    8384        'filterbank': 'self->n_filters',
    8485        'tss': 'self->buf_size',
     86        'pitchshift': 'self->hop_size',
    8587        }
    8688
     
    9597        'wavetable': 'self->hop_size',
    9698        'tss': 'self->buf_size / 2 + 1',
     99        'pitchshift': 'self->hop_size',
    97100        }
    98101
     
    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'])
     
    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    }}
Note: See TracChangeset for help on using the changeset viewer.