Changeset 3da8187 for examples


Ignore:
Timestamp:
Dec 7, 2013, 5:22:21 AM (11 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
61ecd1a
Parents:
466dff3
Message:

examples/: remove -o and -j when unused

Location:
examples
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • examples/aubionotes.c

    r466dff3 r3da8187  
    2323#define PROG_HAS_PITCH 1
    2424#define PROG_HAS_ONSET 1
     25#define PROG_HAS_JACK 1
     26// TODO add PROG_HAS_OUTPUT
    2527#include "parse_args.h"
    2628
  • examples/aubioonset.c

    r466dff3 r3da8187  
    2121#include "utils.h"
    2222#define PROG_HAS_ONSET 1
     23#define PROG_HAS_OUTPUT 1
     24#define PROG_HAS_JACK 1
    2325#include "parse_args.h"
    2426
     
    3638    aubio_wavetable_stop ( wavetable );
    3739  }
    38   aubio_wavetable_do (wavetable, obuf, obuf);
     40  if (mix_input)
     41    aubio_wavetable_do (wavetable, ibuf, obuf);
     42  else
     43    aubio_wavetable_do (wavetable, obuf, obuf);
    3944}
    4045
  • examples/aubiopitch.c

    r466dff3 r3da8187  
    2121#include "utils.h"
    2222#define PROG_HAS_PITCH 1
     23#define PROG_HAS_OUTPUT 1
     24#define PROG_HAS_JACK 1
    2325#include "parse_args.h"
    2426
     
    3335  smpl_t freq = fvec_read_sample(pitch, 0);
    3436  aubio_wavetable_set_amp ( wavetable, aubio_level_lin (ibuf) );
    35   if (freq != 0.0) {
    36     aubio_wavetable_set_freq ( wavetable, freq );
    37   } else {
    38     aubio_wavetable_set_freq ( wavetable, 0.0 );
    39   }
    40   aubio_wavetable_do (wavetable, obuf, obuf);
     37  aubio_wavetable_set_freq ( wavetable, freq );
     38
     39  if (mix_input)
     40    aubio_wavetable_do (wavetable, ibuf, obuf);
     41  else
     42    aubio_wavetable_do (wavetable, obuf, obuf);
    4143}
    4244
  • examples/aubiotrack.c

    r466dff3 r3da8187  
    2121#include "utils.h"
    2222#define PROG_HAS_TEMPO 1
     23#define PROG_HAS_OUTPUT 1
     24#define PROG_HAS_JACK 1
    2325#include "parse_args.h"
    2426
     
    3941    aubio_wavetable_stop ( wavetable );
    4042  }
    41   aubio_wavetable_do (wavetable, obuf, obuf);
     43  if (mix_input)
     44    aubio_wavetable_do (wavetable, ibuf, obuf);
     45  else
     46    aubio_wavetable_do (wavetable, obuf, obuf);
    4247}
    4348
  • examples/parse_args.h

    r466dff3 r3da8187  
    6363      "       -h      --help             display this message\n"
    6464      "       -v      --verbose          be verbose\n"
    65 #ifdef HAVE_JACK
     65#ifdef PROG_HAS_JACK
    6666      "       -j      --jack             use Jack\n"
    6767#endif
    6868      "       -i      --input            input type\n"
     69#ifdef PROG_HAS_OUTPUT
    6970      "       -o      --output           output type\n"
     71#endif
    7072      "       -r      --samplerate       select samplerate\n"
    7173      "       -B      --bufsize          set buffer size\n"
     
    8183#endif /* PROG_HAS_PITCH */
    8284      "       -s      --silence          select silence threshold\n"
     85#ifdef PROG_HAS_OUTPUT
    8386      "       -m      --mix-input        mix input signal with output signal\n"
     87#endif
    8488      );
    8589  exit (exit_code);
     
    9094{
    9195  const char *options = "hv"
    92 #ifdef HAVE_JACK
     96    "i:r:B:H:"
     97#ifdef PROG_HAS_JACK
    9398    "j"
    94 #endif
    95     "i:o:r:B:H:"
     99#endif /* PROG_HAS_JACK */
     100#ifdef PROG_HAS_OUTPUT
     101    "o:"
     102#endif /* PROG_HAS_OUTPUT */
    96103#ifdef PROG_HAS_ONSET
    97104    "O:t:"
     
    105112    {"help",                  0, NULL, 'h'},
    106113    {"verbose",               0, NULL, 'v'},
    107 #ifdef HAVE_JACK
    108     {"jack",                  0, NULL, 'j'},
    109 #endif
    110114    {"input",                 1, NULL, 'i'},
    111     {"output",                1, NULL, 'o'},
    112115    {"samplerate",            1, NULL, 'r'},
    113116    {"bufsize",               1, NULL, 'B'},
    114117    {"hopsize",               1, NULL, 'H'},
     118#ifdef PROG_HAS_JACK
     119    {"jack",                  0, NULL, 'j'},
     120#endif /* PROG_HAS_JACK */
     121#ifdef PROG_HAS_OUTPUT
     122    {"output",                1, NULL, 'o'},
     123#endif /* PROG_HAS_OUTPUT */
    115124#ifdef PROG_HAS_ONSET
    116125    {"onset",                 1, NULL, 'O'},
     
    191200  while (next_option != -1);
    192201
     202  // if unique, use the non option argument as the source
    193203  if ( source_uri == NULL ) {
    194204    if (argc - optind == 1) {
     
    203213  }
    204214
    205   if (source_uri != NULL) {
    206     debug ("Input file : %s\n", source_uri);
    207   } else if (source_uri != NULL && sink_uri != NULL) {
    208     debug ("Input file : %s\n", source_uri);
    209     debug ("Output file : %s\n", sink_uri);
    210   } else {
     215  // if no source, show a message
     216  if (source_uri == NULL) {
    211217#if HAVE_JACK
    212     debug ("Jack input output\n");
     218    verbmsg("No input source given, using jack\n");
    213219    usejack = 1;
    214220#else
  • examples/utils.c

    r466dff3 r3da8187  
    186186#endif
    187187  if (velo == 0) {
    188     outmsg ("%f\n", blocks * hop_size / (float) samplerate);
     188    verbmsg ("%f\n", blocks * hop_size / (float) samplerate);
    189189  } else {
    190     outmsg ("%f\t%f\t", mpitch, blocks * hop_size / (float) samplerate);
     190    verbmsg ("%f\t%f\t", mpitch, blocks * hop_size / (float) samplerate);
    191191  }
    192192}
Note: See TracChangeset for help on using the changeset viewer.