source: examples/utils.h @ 50bc5f2

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5pitchshiftsamplertimestretchyinfft+
Last change on this file since 50bc5f2 was 50bc5f2, checked in by Paul Brossier <piem@piem.org>, 15 years ago

examples/utils.{c,h}: update copyright and license, run through indent

  • Property mode set to 100644
File size: 3.6 KB
RevLine 
[96fb8ad]1/*
[50bc5f2]2  Copyright (C) 2003-2009 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
[96fb8ad]19*/
20
[bd2f2ab]21#include <stdio.h>
22#include <stdlib.h>
23#include <stdarg.h>
24#include <getopt.h>
25#include <unistd.h>
[50bc5f2]26#include <math.h>               /* for isfinite */
[bd2f2ab]27#include <aubio.h>
28#include <aubioext.h>
29
[a3e24ec]30#ifdef HAVE_C99_VARARGS_MACROS
31#define debug(...)              if (verbose) fprintf (stderr, __VA_ARGS__)
32#define errmsg(...)             fprintf (stderr, __VA_ARGS__)
33#define outmsg(...)             fprintf (stdout, __VA_ARGS__)
34#else
35#define debug(format, args...)  if (verbose) fprintf(stderr, format , ##args)
36#define errmsg(format, args...) fprintf(stderr, format , ##args)
37#define outmsg(format, args...) fprintf(stdout, format , ##args)
38#endif
39
[96fb8ad]40
[bd2f2ab]41extern int frames;
[96fb8ad]42extern int verbose;
43extern int usejack;
[62c6075]44extern int usedoubled;
[e24378a]45extern int frames_delay;
[bd2f2ab]46extern unsigned int median;
[50bc5f2]47extern const char *output_filename;
48extern const char *input_filename;
[96fb8ad]49/* defined in utils.c */
50void usage (FILE * stream, int exit_code);
51int parse_args (int argc, char **argv);
[50bc5f2]52void examples_common_init (int argc, char **argv);
53void examples_common_del (void);
54typedef void (aubio_print_func_t) (void);
[b511fa9]55#ifndef HAVE_JACK
[5a1ff62]56typedef int (*aubio_process_func_t)
[50bc5f2]57  (smpl_t ** input, smpl_t ** output, int nframes);
[5a1ff62]58#endif
[50bc5f2]59void examples_common_process (aubio_process_func_t process_func,
60    aubio_print_func_t print);
61void flush_process (aubio_process_func_t process_func,
62    aubio_print_func_t print);
[bd2f2ab]63
64
[50bc5f2]65void send_noteon (int pitch, int velo);
[bd2f2ab]66/** append new note candidate to the note_buffer and return filtered value. we
67 * need to copy the input array as vec_median destroy its input data.*/
[50bc5f2]68void note_append (fvec_t * note_buffer, smpl_t curnote);
69uint_t get_note (fvec_t * note_buffer, fvec_t * note_buffer2);
[bd2f2ab]70
[50bc5f2]71extern const char *output_filename;
72extern const char *input_filename;
73extern const char *onset_filename;
[bd2f2ab]74extern int verbose;
75extern int usejack;
76extern int usedoubled;
77
78
79/* energy,specdiff,hfc,complexdomain,phase */
80extern aubio_onsetdetection_type type_onset;
81extern aubio_onsetdetection_type type_onset2;
82extern smpl_t threshold;
[660cad22]83extern smpl_t silence;
[bd2f2ab]84extern uint_t buffer_size;
85extern uint_t overlap_size;
86extern uint_t channels;
87extern uint_t samplerate;
88
89
[50bc5f2]90extern aubio_sndfile_t *file;
91extern aubio_sndfile_t *fileout;
[bd2f2ab]92
[50bc5f2]93extern aubio_pvoc_t *pv;
94extern fvec_t *ibuf;
95extern fvec_t *obuf;
96extern cvec_t *fftgrain;
97extern fvec_t *woodblock;
[bd2f2ab]98extern aubio_onsetdetection_t *o;
99extern aubio_onsetdetection_t *o2;
100extern fvec_t *onset;
101extern fvec_t *onset2;
102extern int isonset;
[50bc5f2]103extern aubio_pickpeak_t *parms;
[bd2f2ab]104
105
106/* pitch objects */
107extern smpl_t pitch;
[50bc5f2]108extern aubio_pitchdetection_t *pitchdet;
[bd2f2ab]109extern aubio_pitchdetection_type mode;
110extern uint_t median;
111
[50bc5f2]112extern fvec_t *note_buffer;
113extern fvec_t *note_buffer2;
[bd2f2ab]114extern smpl_t curlevel;
115extern smpl_t maxonset;
116
117/* midi objects */
[50bc5f2]118extern aubio_midi_player_t *mplay;
119extern aubio_midi_driver_t *mdriver;
120extern aubio_midi_event_t *event;
[bd2f2ab]121
122extern smpl_t curnote;
123extern smpl_t newnote;
124extern uint_t isready;
125
126/* per example param */
127extern uint_t usepitch;
Note: See TracBrowser for help on using the repository browser.