source: src/effects/pitchshift.h @ bde49c4a

sampler
Last change on this file since bde49c4a was 683d52f5, checked in by Paul Brossier <piem@piem.org>, 8 years ago

src/effects/pitchshift.h: improve documentation

  • Property mode set to 100644
File size: 3.5 KB
Line 
1/*
2  Copyright (C) 2016 Paul Brossier <piem@aubio.org>
3
4  This file is part of aubio.
5
6  aubio is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10
11  aubio is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  GNU General Public License for more details.
15
16  You should have received a copy of the GNU General Public License
17  along with aubio.  If not, see <http://www.gnu.org/licenses/>.
18
19*/
20
21#ifndef AUBIO_PITCHSHIFT_H
22#define AUBIO_PITCHSHIFT_H
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
28/** \file
29
30  Pitch shifting object
31
32  ::aubio_pitchshift_t can be used to transpose a stream of blocks of frames.
33
34  \example effects/test-pitchshift.c
35
36*/
37
38/** pitch shifting object */
39typedef struct _aubio_pitchshift_t aubio_pitchshift_t;
40
41/** execute pitch shifting on an input signal frame
42
43  \param o pitch shifting object as returned by new_aubio_pitchshift()
44  \param in input signal of size [hop_size]
45  \param out output pitch candidates of size [1]
46
47*/
48void aubio_pitchshift_do (aubio_pitchshift_t * o, const fvec_t * in, fvec_t * out);
49
50/** deletion of the pitch shifting object
51
52  \param o pitch shifting object as returned by new_aubio_pitchshift()
53
54*/
55void del_aubio_pitchshift (aubio_pitchshift_t * o);
56
57/** creation of the pitch shifting object
58
59  \param method set pitch shifting algorithm ("default")
60  \param transpose initial pitch transposition
61  \param hop_size step size between two consecutive analysis instant
62  \param samplerate sampling rate of the signal
63
64  \return newly created ::aubio_pitchshift_t
65
66*/
67aubio_pitchshift_t *new_aubio_pitchshift (const char_t * method,
68    smpl_t transpose, uint_t hop_size, uint_t samplerate);
69
70/** get the latency of the pitch shifting object, in samples
71
72  \param o pitch shifting object as returned by ::new_aubio_pitchshift()
73
74  \return latency of the pitch shifting object in samples
75
76*/
77uint_t aubio_pitchshift_get_latency (aubio_pitchshift_t * o);
78
79/** set the pitch scale of the pitch shifting object
80
81  \param o pitch shifting object as returned by new_aubio_pitchshift()
82  \param pitchscale new pitch scale of the pitch shifting object
83
84  \return 0 if successfull, non-zero otherwise
85
86*/
87uint_t aubio_pitchshift_set_pitchscale (aubio_pitchshift_t * o, smpl_t pitchscale);
88
89/** get the pitchscale of the pitch shifting object
90
91  \param o pitch shifting object as returned by ::new_aubio_pitchshift()
92
93  \return pitchscale of the pitch shifting object
94
95*/
96smpl_t aubio_pitchshift_get_pitchscale (aubio_pitchshift_t * o);
97
98/** set the transposition of the pitch shifting object, in semitones
99
100  \param o pitch shifting object as returned by new_aubio_pitchshift()
101  \param transpose new pitch transposition of the pitch shifting object, expressed
102  in semitones (should be in the range [-24;+24])
103
104  \return 0 if successfull, non-zero otherwise
105
106*/
107uint_t aubio_pitchshift_set_transpose (aubio_pitchshift_t * o, smpl_t transpose);
108
109/** get the transposition of the pitch shifting object, in semitones
110
111  \param o pitch shifting object as returned by ::new_aubio_pitchshift()
112
113  \return transposition of the pitch shifting object, in semitones
114
115*/
116smpl_t aubio_pitchshift_get_transpose (aubio_pitchshift_t * o);
117
118#ifdef __cplusplus
119}
120#endif
121
122#endif /* AUBIO_PITCHSHIFT_H */
Note: See TracBrowser for help on using the repository browser.