source: src/effects/pitchshift.h @ 24198a1

feature/timestretch
Last change on this file since 24198a1 was 24198a1, checked in by Paul Brossier <piem@piem.org>, 14 months ago

[effects] improve pitchscale 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  pitchscale is a frequency ratio. It should be in the range [0.25, 4].
85
86  \return 0 if successfull, non-zero otherwise
87
88*/
89uint_t aubio_pitchshift_set_pitchscale (aubio_pitchshift_t * o, smpl_t pitchscale);
90
91/** get the pitchscale of the pitch shifting object
92
93  \param o pitch shifting object as returned by ::new_aubio_pitchshift()
94
95  \return pitchscale of the pitch shifting object
96
97*/
98smpl_t aubio_pitchshift_get_pitchscale (aubio_pitchshift_t * o);
99
100/** set the transposition of the pitch shifting object, in semitones
101
102  \param o pitch shifting object as returned by new_aubio_pitchshift()
103  \param transpose new pitch transposition of the pitch shifting object, expressed
104  in semitones (should be in the range [-24;+24])
105
106  \return 0 if successfull, non-zero otherwise
107
108*/
109uint_t aubio_pitchshift_set_transpose (aubio_pitchshift_t * o, smpl_t transpose);
110
111/** get the transposition of the pitch shifting object, in semitones
112
113  \param o pitch shifting object as returned by ::new_aubio_pitchshift()
114
115  \return transposition of the pitch shifting object, in semitones
116
117*/
118smpl_t aubio_pitchshift_get_transpose (aubio_pitchshift_t * o);
119
120#ifdef __cplusplus
121}
122#endif
123
124#endif /* AUBIO_PITCHSHIFT_H */
Note: See TracBrowser for help on using the repository browser.