2003-03-11 16:56:45 +00:00
|
|
|
/* FluidSynth - A Software Synthesizer
|
|
|
|
*
|
|
|
|
* Copyright (C) 2003 Peter Hanappe and others.
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2 of
|
|
|
|
* the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
2007-03-04 16:45:05 +00:00
|
|
|
*
|
2003-03-11 16:56:45 +00:00
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the Free
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
|
|
|
* 02111-1307, USA
|
|
|
|
*/
|
|
|
|
|
2007-09-20 07:47:38 +00:00
|
|
|
#if HAVE_CONFIG_H
|
2005-06-29 18:07:46 +00:00
|
|
|
#include "config.h"
|
2007-09-20 07:47:38 +00:00
|
|
|
#endif
|
2003-03-11 16:56:45 +00:00
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2003-06-15 21:16:21 +00:00
|
|
|
#include "fluidsynth_priv.h"
|
|
|
|
|
2003-03-11 16:56:45 +00:00
|
|
|
#if !defined(WIN32) && !defined(MACINTOSH)
|
|
|
|
#define _GNU_SOURCE
|
|
|
|
#include <getopt.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(WIN32)
|
|
|
|
#include <windows.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "fluidsynth.h"
|
|
|
|
|
2003-06-12 10:59:52 +00:00
|
|
|
#if defined(WIN32) && !defined(MINGW32)
|
|
|
|
#include "config_win32.h"
|
|
|
|
#endif
|
|
|
|
|
2003-03-12 00:58:20 +00:00
|
|
|
#ifdef HAVE_SIGNAL_H
|
|
|
|
#include "signal.h"
|
|
|
|
#endif
|
|
|
|
|
2006-02-19 10:01:58 +00:00
|
|
|
#include "fluid_lash.h"
|
2003-03-11 16:56:45 +00:00
|
|
|
|
|
|
|
#ifndef WITH_MIDI
|
|
|
|
#define WITH_MIDI 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void print_usage(void);
|
|
|
|
void print_help(void);
|
|
|
|
void print_welcome(void);
|
|
|
|
|
|
|
|
static fluid_cmd_handler_t* newclient(void* data, char* addr);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* the globals
|
|
|
|
*/
|
2005-06-29 18:07:46 +00:00
|
|
|
fluid_cmd_handler_t* cmd_handler = NULL;
|
2006-02-19 10:01:58 +00:00
|
|
|
int option_help = 0; /* set to 1 if "-o help" is specified */
|
2003-03-11 16:56:45 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* support for the getopt function
|
|
|
|
*/
|
|
|
|
#if !defined(WIN32) && !defined(MACINTOSH)
|
2006-02-19 10:01:58 +00:00
|
|
|
#define GETOPT_SUPPORT 1
|
2003-03-11 16:56:45 +00:00
|
|
|
int getopt(int argc, char * const argv[], const char *optstring);
|
|
|
|
extern char *optarg;
|
|
|
|
extern int optind, opterr, optopt;
|
|
|
|
#endif
|
|
|
|
|
2003-03-12 00:58:20 +00:00
|
|
|
|
|
|
|
/* process_o_cmd_line_option
|
|
|
|
*
|
|
|
|
* Purpose:
|
2007-03-04 16:45:05 +00:00
|
|
|
* Process a command line option -o setting=value,
|
2003-03-11 16:56:45 +00:00
|
|
|
* for example: -o synth.polyhony=16
|
|
|
|
*/
|
|
|
|
void process_o_cmd_line_option(fluid_settings_t* settings, char* optarg){
|
|
|
|
char* val;
|
|
|
|
for (val = optarg; *val != '\0'; val++) {
|
|
|
|
if (*val == '=') {
|
|
|
|
*val++ = 0;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2006-02-19 10:01:58 +00:00
|
|
|
|
|
|
|
/* did user request list of settings */
|
|
|
|
if (strcmp (optarg, "help") == 0)
|
|
|
|
{
|
|
|
|
option_help = 1;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2003-05-29 15:43:52 +00:00
|
|
|
/* At this point:
|
|
|
|
* optarg => "synth.polyphony"
|
|
|
|
* val => "16"
|
2003-03-11 16:56:45 +00:00
|
|
|
*/
|
2003-05-29 15:43:52 +00:00
|
|
|
switch(fluid_settings_get_type(settings, optarg)){
|
|
|
|
case FLUID_NUM_TYPE:
|
|
|
|
if (fluid_settings_setnum(settings, optarg, atof(val))){
|
|
|
|
break;
|
|
|
|
};
|
|
|
|
case FLUID_INT_TYPE:
|
|
|
|
if (fluid_settings_setint(settings, optarg, atoi(val))){
|
|
|
|
break;
|
|
|
|
};
|
|
|
|
case FLUID_STR_TYPE:
|
|
|
|
if (fluid_settings_setstr(settings, optarg, val)){
|
|
|
|
break;
|
|
|
|
};
|
|
|
|
default:
|
|
|
|
fprintf (stderr, "Settings argument on command line: Failed to set \"%s\" to \"%s\".\n"
|
|
|
|
"Most likely the parameter \"%s\" does not exist.\n", optarg, val, optarg);
|
2007-03-04 16:45:05 +00:00
|
|
|
}
|
2003-03-11 16:56:45 +00:00
|
|
|
}
|
|
|
|
|
2006-02-19 10:01:58 +00:00
|
|
|
static void
|
|
|
|
print_pretty_int (int i)
|
|
|
|
{
|
|
|
|
if (i == INT_MAX) printf ("MAXINT");
|
|
|
|
else if (i == INT_MIN) printf ("MININT");
|
|
|
|
else printf ("%d", i);
|
|
|
|
}
|
|
|
|
|
2009-10-12 19:18:06 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int count; /* Total count of options */
|
|
|
|
int curindex; /* Current index in options */
|
|
|
|
} OptionBag;
|
|
|
|
|
2009-10-05 00:13:48 +00:00
|
|
|
/* Function to display each string option value */
|
|
|
|
static void
|
|
|
|
settings_option_foreach_func (void *data, char *name, char *option)
|
|
|
|
{
|
2009-10-12 19:18:06 +00:00
|
|
|
OptionBag *bag = data;
|
|
|
|
|
|
|
|
bag->curindex++;
|
|
|
|
|
|
|
|
if (bag->curindex < bag->count)
|
|
|
|
printf ("'%s',", option);
|
|
|
|
else printf ("'%s'", option);
|
2009-10-05 00:13:48 +00:00
|
|
|
}
|
|
|
|
|
2006-02-19 10:01:58 +00:00
|
|
|
/* fluid_settings_foreach function for displaying option help "-o help" */
|
|
|
|
static void
|
|
|
|
settings_foreach_func (void *data, char *name, int type)
|
|
|
|
{
|
|
|
|
fluid_settings_t *settings = (fluid_settings_t *)data;
|
|
|
|
double dmin, dmax, ddef;
|
|
|
|
int imin, imax, idef;
|
|
|
|
char *defstr;
|
2009-10-05 00:13:48 +00:00
|
|
|
int count;
|
2009-10-12 19:18:06 +00:00
|
|
|
OptionBag bag;
|
2006-02-19 10:01:58 +00:00
|
|
|
|
|
|
|
switch (type)
|
|
|
|
{
|
|
|
|
case FLUID_NUM_TYPE:
|
|
|
|
fluid_settings_getnum_range (settings, name, &dmin, &dmax);
|
|
|
|
ddef = fluid_settings_getnum_default (settings, name);
|
|
|
|
printf ("%-24s FLOAT [min=%0.3f, max=%0.3f, def=%0.3f]\n",
|
|
|
|
name, dmin, dmax, ddef);
|
|
|
|
break;
|
|
|
|
case FLUID_INT_TYPE:
|
|
|
|
fluid_settings_getint_range (settings, name, &imin, &imax);
|
|
|
|
idef = fluid_settings_getint_default (settings, name);
|
|
|
|
printf ("%-24s INT [min=", name);
|
|
|
|
print_pretty_int (imin);
|
|
|
|
printf (", max=");
|
|
|
|
print_pretty_int (imax);
|
|
|
|
printf (", def=");
|
|
|
|
print_pretty_int (idef);
|
|
|
|
printf ("]\n");
|
|
|
|
break;
|
|
|
|
case FLUID_STR_TYPE:
|
|
|
|
printf ("%-24s STR", name);
|
2009-10-05 00:13:48 +00:00
|
|
|
|
|
|
|
defstr = fluid_settings_getstr_default (settings, name);
|
|
|
|
count = fluid_settings_option_count (settings, name);
|
|
|
|
|
|
|
|
if (defstr || count > 0)
|
|
|
|
{
|
|
|
|
if (defstr && count > 0) printf (" [def='%s' vals:", defstr);
|
|
|
|
else if (defstr) printf (" [def='%s'", defstr);
|
|
|
|
else printf (" [vals:");
|
|
|
|
|
|
|
|
if (count > 0)
|
2009-10-12 19:18:06 +00:00
|
|
|
{
|
|
|
|
bag.count = count;
|
|
|
|
bag.curindex = 0;
|
|
|
|
fluid_settings_foreach_option_alpha (settings, name, &bag,
|
2009-10-05 00:13:48 +00:00
|
|
|
settings_option_foreach_func);
|
2009-10-12 19:18:06 +00:00
|
|
|
}
|
|
|
|
|
2009-10-05 00:13:48 +00:00
|
|
|
printf ("]\n");
|
|
|
|
}
|
2006-02-19 10:01:58 +00:00
|
|
|
else printf ("\n");
|
|
|
|
break;
|
|
|
|
case FLUID_SET_TYPE:
|
|
|
|
printf ("%-24s SET\n", name);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-10-19 05:41:07 +00:00
|
|
|
/* Output options for a setting string to stdout */
|
|
|
|
static void
|
|
|
|
show_settings_str_options (fluid_settings_t *settings, char *name)
|
|
|
|
{
|
|
|
|
OptionBag bag;
|
|
|
|
|
|
|
|
bag.count = fluid_settings_option_count (settings, name);
|
|
|
|
bag.curindex = 0;
|
|
|
|
fluid_settings_foreach_option_alpha (settings, name, &bag,
|
|
|
|
settings_option_foreach_func);
|
|
|
|
printf ("\n");
|
|
|
|
}
|
|
|
|
|
2009-10-03 18:12:19 +00:00
|
|
|
static void
|
|
|
|
fast_render_loop(fluid_settings_t* settings, fluid_synth_t* synth, fluid_player_t* player)
|
2009-04-25 15:17:15 +00:00
|
|
|
{
|
|
|
|
fluid_file_renderer_t* renderer;
|
2009-09-22 07:04:07 +00:00
|
|
|
|
2009-10-05 07:03:42 +00:00
|
|
|
renderer = new_fluid_file_renderer (synth);
|
|
|
|
if (!renderer) return;
|
2009-04-25 15:17:15 +00:00
|
|
|
|
|
|
|
while (fluid_player_get_status(player) == FLUID_PLAYER_PLAYING) {
|
|
|
|
if (fluid_file_renderer_process_block(renderer) != FLUID_OK) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
delete_fluid_file_renderer(renderer);
|
|
|
|
}
|
2003-03-12 00:58:20 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_SIGNAL_H
|
2007-03-04 16:45:05 +00:00
|
|
|
/*
|
2003-03-12 00:58:20 +00:00
|
|
|
* handle_signal
|
|
|
|
*/
|
|
|
|
void handle_signal(int sig_num)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* main
|
|
|
|
*/
|
2007-03-04 16:45:05 +00:00
|
|
|
int main(int argc, char** argv)
|
2003-03-11 16:56:45 +00:00
|
|
|
{
|
|
|
|
fluid_settings_t* settings;
|
|
|
|
int arg1 = 1;
|
|
|
|
char buf[512];
|
2009-10-07 05:20:55 +00:00
|
|
|
int c, i;
|
2003-03-11 16:56:45 +00:00
|
|
|
int interactive = 1;
|
|
|
|
int midi_in = 1;
|
2007-03-04 16:45:05 +00:00
|
|
|
fluid_player_t* player = NULL;
|
2003-03-11 16:56:45 +00:00
|
|
|
fluid_midi_router_t* router = NULL;
|
2009-09-22 07:04:07 +00:00
|
|
|
//fluid_sequencer_t* sequencer = NULL;
|
2003-03-11 16:56:45 +00:00
|
|
|
fluid_midi_driver_t* mdriver = NULL;
|
|
|
|
fluid_audio_driver_t* adriver = NULL;
|
|
|
|
fluid_synth_t* synth = NULL;
|
|
|
|
fluid_server_t* server = NULL;
|
2006-02-19 10:01:58 +00:00
|
|
|
char* config_file = NULL;
|
2003-03-11 16:56:45 +00:00
|
|
|
int audio_groups = 0;
|
|
|
|
int audio_channels = 0;
|
|
|
|
int with_server = 0;
|
2003-04-03 21:32:56 +00:00
|
|
|
int dump = 0;
|
2009-04-25 15:17:15 +00:00
|
|
|
int fast_render = 0;
|
2006-02-19 10:01:58 +00:00
|
|
|
int connect_lash = 1;
|
2009-10-03 18:12:19 +00:00
|
|
|
char *optchars = "a:C:c:dE:f:F:G:g:hijK:L:lm:nO:o:p:R:r:sT:Vvz:";
|
2006-02-19 10:01:58 +00:00
|
|
|
#ifdef LASH_ENABLED
|
|
|
|
int enabled_lash = 0; /* set to TRUE if lash gets enabled */
|
|
|
|
fluid_lash_args_t *lash_args;
|
2003-08-26 05:04:20 +00:00
|
|
|
|
2006-02-19 10:01:58 +00:00
|
|
|
lash_args = fluid_lash_extract_args (&argc, &argv);
|
2003-03-11 16:56:45 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
settings = new_fluid_settings();
|
|
|
|
|
2006-02-19 10:01:58 +00:00
|
|
|
#ifdef GETOPT_SUPPORT /* pre section of GETOPT supported argument handling */
|
2003-03-11 16:56:45 +00:00
|
|
|
opterr = 0;
|
|
|
|
|
|
|
|
while (1) {
|
|
|
|
int option_index = 0;
|
|
|
|
|
|
|
|
static struct option long_options[] = {
|
2006-02-19 10:01:58 +00:00
|
|
|
{"audio-bufcount", 1, 0, 'c'},
|
|
|
|
{"audio-bufsize", 1, 0, 'z'},
|
2003-03-11 16:56:45 +00:00
|
|
|
{"audio-channels", 1, 0, 'L'},
|
2006-02-19 10:01:58 +00:00
|
|
|
{"audio-driver", 1, 0, 'a'},
|
2009-10-03 18:12:19 +00:00
|
|
|
{"audio-file-endian", 1, 0, 'E'},
|
|
|
|
{"audio-file-format", 1, 0, 'O'},
|
|
|
|
{"audio-file-type", 1, 0, 'T'},
|
2003-03-11 16:56:45 +00:00
|
|
|
{"audio-groups", 1, 0, 'G'},
|
|
|
|
{"chorus", 1, 0, 'C'},
|
2006-02-19 10:01:58 +00:00
|
|
|
{"connect-jack-outputs", 0, 0, 'j'},
|
|
|
|
{"disable-lash", 0, 0, 'l'},
|
|
|
|
{"dump", 0, 0, 'd'},
|
2009-04-25 15:17:15 +00:00
|
|
|
{"fast-render", 1, 0, 'F'},
|
2003-03-11 16:56:45 +00:00
|
|
|
{"gain", 1, 0, 'g'},
|
|
|
|
{"help", 0, 0, 'h'},
|
2006-02-19 10:01:58 +00:00
|
|
|
{"load-config", 1, 0, 'f'},
|
|
|
|
{"midi-channels", 1, 0, 'K'},
|
|
|
|
{"midi-driver", 1, 0, 'm'},
|
|
|
|
{"no-midi-in", 0, 0, 'n'},
|
2003-03-11 16:56:45 +00:00
|
|
|
{"no-shell", 0, 0, 'i'},
|
|
|
|
{"option", 1, 0, 'o'},
|
2008-09-15 04:17:24 +00:00
|
|
|
{"portname", 1, 0, 'p'},
|
2006-02-19 10:01:58 +00:00
|
|
|
{"reverb", 1, 0, 'R'},
|
|
|
|
{"sample-rate", 1, 0, 'r'},
|
|
|
|
{"server", 0, 0, 's'},
|
|
|
|
{"verbose", 0, 0, 'v'},
|
|
|
|
{"version", 0, 0, 'V'},
|
2003-03-11 16:56:45 +00:00
|
|
|
{0, 0, 0, 0}
|
|
|
|
};
|
|
|
|
|
2006-02-19 10:01:58 +00:00
|
|
|
c = getopt_long(argc, argv, optchars, long_options, &option_index);
|
2003-03-11 16:56:45 +00:00
|
|
|
if (c == -1) {
|
|
|
|
break;
|
|
|
|
}
|
2006-02-19 10:01:58 +00:00
|
|
|
#else /* "pre" section to non getopt argument handling */
|
|
|
|
for (i = 1; i < argc; i++) {
|
|
|
|
char *optarg;
|
|
|
|
|
|
|
|
/* Skip non switch arguments (assume they are file names) */
|
2008-09-15 04:17:24 +00:00
|
|
|
if ((argv[i][0] != '-') || (argv[i][1] == '\0')) break;
|
2006-02-19 10:01:58 +00:00
|
|
|
|
|
|
|
c = argv[i][1];
|
|
|
|
|
|
|
|
optarg = strchr (optchars, c); /* find the option character in optchars */
|
|
|
|
if (optarg && optarg[1] == ':') /* colon follows if switch argument expected */
|
|
|
|
{
|
|
|
|
if (++i >= argc)
|
|
|
|
{
|
|
|
|
printf ("Option -%c requires an argument\n", c);
|
|
|
|
print_usage();
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
optarg = argv[i];
|
|
|
|
if (optarg[0] == '-')
|
|
|
|
{
|
|
|
|
printf ("Expected argument to option -%c found switch instead\n", c);
|
|
|
|
print_usage();
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else optarg = "";
|
|
|
|
#endif
|
2003-03-11 16:56:45 +00:00
|
|
|
|
|
|
|
switch (c) {
|
2006-02-19 10:01:58 +00:00
|
|
|
#ifdef GETOPT_SUPPORT
|
|
|
|
case 0: /* shouldn't normally happen, a long option's flag is set to NULL */
|
2003-03-11 16:56:45 +00:00
|
|
|
printf ("option %s", long_options[option_index].name);
|
|
|
|
if (optarg) {
|
|
|
|
printf (" with arg %s", optarg);
|
|
|
|
}
|
|
|
|
printf ("\n");
|
|
|
|
break;
|
2006-02-19 10:01:58 +00:00
|
|
|
#endif
|
2003-03-11 16:56:45 +00:00
|
|
|
case 'a':
|
2009-10-19 05:41:07 +00:00
|
|
|
if (FLUID_STRCMP (optarg, "help") == 0)
|
|
|
|
{
|
|
|
|
print_welcome ();
|
|
|
|
printf ("-a options (audio driver):\n ");
|
|
|
|
show_settings_str_options (settings, "audio.driver");
|
|
|
|
exit (0);
|
|
|
|
}
|
|
|
|
else fluid_settings_setstr(settings, "audio.driver", optarg);
|
2003-03-11 16:56:45 +00:00
|
|
|
break;
|
2006-02-19 10:01:58 +00:00
|
|
|
case 'C':
|
|
|
|
if ((optarg != NULL) && ((strcmp(optarg, "0") == 0) || (strcmp(optarg, "no") == 0))) {
|
|
|
|
fluid_settings_setstr(settings, "synth.chorus.active", "no");
|
|
|
|
} else {
|
|
|
|
fluid_settings_setstr(settings, "synth.chorus.active", "yes");
|
|
|
|
}
|
2003-03-11 16:56:45 +00:00
|
|
|
break;
|
|
|
|
case 'c':
|
2003-03-27 09:37:53 +00:00
|
|
|
fluid_settings_setint(settings, "audio.periods", atoi(optarg));
|
2003-03-11 16:56:45 +00:00
|
|
|
break;
|
2006-02-19 10:01:58 +00:00
|
|
|
case 'd':
|
|
|
|
fluid_settings_setstr(settings, "synth.dump", "yes");
|
|
|
|
dump = 1;
|
|
|
|
break;
|
2009-10-03 18:12:19 +00:00
|
|
|
case 'E':
|
|
|
|
if (FLUID_STRCMP (optarg, "help") == 0)
|
|
|
|
{
|
|
|
|
print_welcome ();
|
|
|
|
printf ("-E options (audio file byte order):\n ");
|
2009-10-19 05:41:07 +00:00
|
|
|
show_settings_str_options (settings, "audio.file.endian");
|
2009-10-03 18:12:19 +00:00
|
|
|
|
2009-10-03 18:21:12 +00:00
|
|
|
#if LIBSNDFILE_SUPPORT
|
2009-10-19 05:41:07 +00:00
|
|
|
printf ("\nauto: Use audio file format's default endian byte order\n"
|
2009-10-03 18:12:19 +00:00
|
|
|
"cpu: Use CPU native byte order\n");
|
2009-10-03 18:21:12 +00:00
|
|
|
#else
|
2009-10-19 05:41:07 +00:00
|
|
|
printf ("\nNOTE: No libsndfile support!\n"
|
2009-10-03 18:21:12 +00:00
|
|
|
"cpu: Use CPU native byte order\n");
|
|
|
|
#endif
|
2009-10-03 18:12:19 +00:00
|
|
|
exit (0);
|
|
|
|
}
|
|
|
|
else fluid_settings_setstr(settings, "audio.file.endian", optarg);
|
|
|
|
break;
|
2006-02-19 10:01:58 +00:00
|
|
|
case 'f':
|
|
|
|
config_file = optarg;
|
|
|
|
break;
|
2009-04-25 15:17:15 +00:00
|
|
|
case 'F':
|
|
|
|
fluid_settings_setstr(settings, "audio.file.name", optarg);
|
|
|
|
fast_render = 1;
|
|
|
|
break;
|
2006-02-19 10:01:58 +00:00
|
|
|
case 'G':
|
|
|
|
audio_groups = atoi(optarg);
|
|
|
|
break;
|
2003-03-11 16:56:45 +00:00
|
|
|
case 'g':
|
|
|
|
fluid_settings_setnum(settings, "synth.gain", atof(optarg));
|
|
|
|
break;
|
2006-02-19 10:01:58 +00:00
|
|
|
case 'h':
|
|
|
|
print_help();
|
2003-03-11 16:56:45 +00:00
|
|
|
break;
|
2006-02-19 10:01:58 +00:00
|
|
|
case 'i':
|
|
|
|
interactive = 0;
|
|
|
|
break;
|
|
|
|
case 'j':
|
|
|
|
fluid_settings_setint(settings, "audio.jack.autoconnect", 1);
|
2004-03-29 10:05:18 +00:00
|
|
|
break;
|
2006-02-19 10:01:58 +00:00
|
|
|
case 'K':
|
|
|
|
fluid_settings_setint(settings, "synth.midi-channels", atoi(optarg));
|
2003-08-26 05:04:20 +00:00
|
|
|
break;
|
2003-03-11 16:56:45 +00:00
|
|
|
case 'L':
|
|
|
|
audio_channels = atoi(optarg);
|
|
|
|
fluid_settings_setint(settings, "synth.audio-channels", audio_channels);
|
|
|
|
break;
|
2006-02-19 10:01:58 +00:00
|
|
|
case 'l': /* disable LASH */
|
|
|
|
connect_lash = 0;
|
2003-03-11 16:56:45 +00:00
|
|
|
break;
|
2006-02-19 10:01:58 +00:00
|
|
|
case 'm':
|
2009-10-19 05:41:07 +00:00
|
|
|
if (FLUID_STRCMP (optarg, "help") == 0)
|
|
|
|
{
|
|
|
|
print_welcome ();
|
|
|
|
printf ("-m options (MIDI driver):\n ");
|
|
|
|
show_settings_str_options (settings, "midi.driver");
|
|
|
|
exit (0);
|
|
|
|
}
|
|
|
|
else fluid_settings_setstr(settings, "midi.driver", optarg);
|
2003-03-11 16:56:45 +00:00
|
|
|
break;
|
2006-02-19 10:01:58 +00:00
|
|
|
case 'n':
|
|
|
|
midi_in = 0;
|
2003-03-11 16:56:45 +00:00
|
|
|
break;
|
2009-10-03 18:12:19 +00:00
|
|
|
case 'O':
|
|
|
|
if (FLUID_STRCMP (optarg, "help") == 0)
|
|
|
|
{
|
|
|
|
print_welcome ();
|
2009-10-19 05:41:07 +00:00
|
|
|
printf ("-O options (audio file format):\n ");
|
|
|
|
show_settings_str_options (settings, "audio.file.format");
|
2009-10-03 18:12:19 +00:00
|
|
|
|
2009-10-03 18:21:12 +00:00
|
|
|
#if LIBSNDFILE_SUPPORT
|
2009-10-19 05:41:07 +00:00
|
|
|
printf ("\ns8, s16, s24, s32: Signed PCM audio of the given number of bits\n");
|
|
|
|
printf ("float, double: 32 bit and 64 bit floating point audio\n");
|
|
|
|
printf ("u8: Unsigned 8 bit audio\n");
|
2009-10-03 18:21:12 +00:00
|
|
|
#else
|
2009-10-19 05:41:07 +00:00
|
|
|
printf ("\nNOTE: No libsndfile support!\n");
|
2009-10-03 18:21:12 +00:00
|
|
|
#endif
|
2009-10-03 18:12:19 +00:00
|
|
|
exit (0);
|
|
|
|
}
|
|
|
|
else fluid_settings_setstr(settings, "audio.file.format", optarg);
|
|
|
|
break;
|
2007-03-04 16:45:05 +00:00
|
|
|
case 'o':
|
2006-02-19 10:01:58 +00:00
|
|
|
process_o_cmd_line_option(settings, optarg);
|
2003-03-11 16:56:45 +00:00
|
|
|
break;
|
2008-09-15 04:17:24 +00:00
|
|
|
case 'p' :
|
|
|
|
fluid_settings_setstr(settings, "midi.portname", optarg);
|
|
|
|
break;
|
2003-03-11 16:56:45 +00:00
|
|
|
case 'R':
|
|
|
|
if ((optarg != NULL) && ((strcmp(optarg, "0") == 0) || (strcmp(optarg, "no") == 0))) {
|
|
|
|
fluid_settings_setstr(settings, "synth.reverb.active", "no");
|
|
|
|
} else {
|
|
|
|
fluid_settings_setstr(settings, "synth.reverb.active", "yes");
|
|
|
|
}
|
|
|
|
break;
|
2006-02-19 10:01:58 +00:00
|
|
|
case 'r':
|
|
|
|
fluid_settings_setnum(settings, "synth.sample-rate", atof(optarg));
|
2003-03-11 16:56:45 +00:00
|
|
|
break;
|
|
|
|
case 's':
|
|
|
|
with_server = 1;
|
|
|
|
break;
|
2009-10-03 18:12:19 +00:00
|
|
|
case 'T':
|
|
|
|
if (FLUID_STRCMP (optarg, "help") == 0)
|
|
|
|
{
|
|
|
|
print_welcome ();
|
|
|
|
printf ("-T options (audio file type):\n ");
|
2009-10-19 05:41:07 +00:00
|
|
|
show_settings_str_options (settings, "audio.file.type");
|
2009-10-03 18:12:19 +00:00
|
|
|
|
2009-10-03 18:21:12 +00:00
|
|
|
#if LIBSNDFILE_SUPPORT
|
2009-10-19 05:41:07 +00:00
|
|
|
printf ("\nauto: Determine type from file name extension, defaults to \"wav\"\n");
|
2009-10-03 18:21:12 +00:00
|
|
|
#else
|
2009-10-19 05:41:07 +00:00
|
|
|
printf ("\nNOTE: No libsndfile support!\n");
|
2009-10-03 18:21:12 +00:00
|
|
|
#endif
|
2009-10-03 18:12:19 +00:00
|
|
|
exit (0);
|
|
|
|
}
|
|
|
|
else fluid_settings_setstr(settings, "audio.file.type", optarg);
|
|
|
|
break;
|
2003-03-11 16:56:45 +00:00
|
|
|
case 'V':
|
2006-02-19 10:01:58 +00:00
|
|
|
printf("FluidSynth %s\n", VERSION);
|
|
|
|
exit (0);
|
2003-03-11 16:56:45 +00:00
|
|
|
break;
|
2006-02-19 10:01:58 +00:00
|
|
|
case 'v':
|
|
|
|
fluid_settings_setstr(settings, "synth.verbose", "yes");
|
2003-03-11 16:56:45 +00:00
|
|
|
break;
|
2006-02-19 10:01:58 +00:00
|
|
|
case 'z':
|
|
|
|
fluid_settings_setint(settings, "audio.period-size", atoi(optarg));
|
|
|
|
break;
|
|
|
|
#ifdef GETOPT_SUPPORT
|
2003-03-11 16:56:45 +00:00
|
|
|
case '?':
|
|
|
|
printf ("Unknown option %c\n", optopt);
|
|
|
|
print_usage();
|
|
|
|
exit(0);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
printf ("?? getopt returned character code 0%o ??\n", c);
|
2006-02-19 10:01:58 +00:00
|
|
|
break;
|
|
|
|
#else /* Non getopt default case */
|
|
|
|
default:
|
|
|
|
printf ("Unknown switch '%c'\n", c);
|
|
|
|
print_usage();
|
|
|
|
exit(0);
|
|
|
|
break;
|
|
|
|
#endif
|
|
|
|
} /* end of switch statement */
|
|
|
|
} /* end of loop */
|
2003-03-11 16:56:45 +00:00
|
|
|
|
2006-02-19 10:01:58 +00:00
|
|
|
#ifdef GETOPT_SUPPORT
|
2003-03-11 16:56:45 +00:00
|
|
|
arg1 = optind;
|
|
|
|
#else
|
2006-02-19 10:01:58 +00:00
|
|
|
arg1 = i;
|
|
|
|
#endif
|
2003-03-11 16:56:45 +00:00
|
|
|
|
2006-02-19 10:01:58 +00:00
|
|
|
/* option help requested? "-o help" */
|
|
|
|
if (option_help)
|
|
|
|
{
|
|
|
|
print_welcome ();
|
|
|
|
printf ("FluidSynth settings:\n");
|
2009-10-05 00:13:48 +00:00
|
|
|
fluid_settings_foreach_alpha (settings, settings, settings_foreach_func);
|
2006-02-19 10:01:58 +00:00
|
|
|
exit (0);
|
2003-03-11 16:56:45 +00:00
|
|
|
}
|
|
|
|
|
2009-04-27 19:13:49 +00:00
|
|
|
g_thread_init (NULL);
|
|
|
|
|
2003-03-11 16:56:45 +00:00
|
|
|
#ifdef WIN32
|
|
|
|
SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS);
|
|
|
|
#endif
|
|
|
|
|
2006-02-20 11:48:06 +00:00
|
|
|
#ifdef LASH_ENABLED
|
2006-02-19 10:01:58 +00:00
|
|
|
/* connect to the lash server */
|
|
|
|
if (connect_lash)
|
2003-08-26 05:04:20 +00:00
|
|
|
{
|
2006-02-19 10:01:58 +00:00
|
|
|
enabled_lash = fluid_lash_connect (lash_args);
|
|
|
|
fluid_settings_setint (settings, "lash.enable", enabled_lash ? 1 : 0);
|
2003-03-27 09:37:53 +00:00
|
|
|
}
|
2006-02-20 11:48:06 +00:00
|
|
|
#endif
|
|
|
|
|
2003-03-11 16:56:45 +00:00
|
|
|
/* The 'groups' setting is only relevant for LADSPA operation
|
|
|
|
* If not given, set number groups to number of audio channels, because
|
|
|
|
* they are the same (there is nothing between synth output and 'sound card')
|
|
|
|
*/
|
|
|
|
if ((audio_groups == 0) && (audio_channels != 0)) {
|
|
|
|
audio_groups = audio_channels;
|
2007-03-04 16:45:05 +00:00
|
|
|
}
|
2003-03-11 16:56:45 +00:00
|
|
|
fluid_settings_setint(settings, "synth.audio-groups", audio_groups);
|
2007-03-04 16:45:05 +00:00
|
|
|
|
2003-03-11 16:56:45 +00:00
|
|
|
/* create the synthesizer */
|
|
|
|
synth = new_fluid_synth(settings);
|
|
|
|
if (synth == NULL) {
|
2004-08-06 09:56:24 +00:00
|
|
|
fprintf(stderr, "Failed to create the synthesizer\n");
|
2003-03-11 16:56:45 +00:00
|
|
|
exit(-1);
|
|
|
|
}
|
2007-03-04 16:45:05 +00:00
|
|
|
|
2003-03-11 16:56:45 +00:00
|
|
|
cmd_handler = new_fluid_cmd_handler(synth);
|
|
|
|
if (cmd_handler == NULL) {
|
2004-08-06 09:56:24 +00:00
|
|
|
fprintf(stderr, "Failed to create the command handler\n");
|
2003-03-11 16:56:45 +00:00
|
|
|
goto cleanup;
|
|
|
|
}
|
|
|
|
|
2006-12-10 16:02:04 +00:00
|
|
|
/* load the soundfonts (check that all non options are SoundFont or MIDI files) */
|
2003-03-11 16:56:45 +00:00
|
|
|
for (i = arg1; i < argc; i++) {
|
2006-12-10 16:02:04 +00:00
|
|
|
if (fluid_is_soundfont(argv[i]))
|
|
|
|
{
|
|
|
|
if (fluid_synth_sfload(synth, argv[i], 1) == -1)
|
2004-08-06 09:56:24 +00:00
|
|
|
fprintf(stderr, "Failed to load the SoundFont %s\n", argv[i]);
|
2003-03-11 16:56:45 +00:00
|
|
|
}
|
2006-12-10 16:02:04 +00:00
|
|
|
else if (!fluid_is_midifile(argv[i]))
|
|
|
|
fprintf (stderr, "Parameter '%s' not a SoundFont or MIDI file or error occurred identifying it.\n",
|
|
|
|
argv[i]);
|
2003-03-11 16:56:45 +00:00
|
|
|
}
|
2003-03-12 00:58:20 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_SIGNAL_H
|
|
|
|
/* signal(SIGINT, handle_signal); */
|
|
|
|
#endif
|
|
|
|
|
2009-04-25 15:17:15 +00:00
|
|
|
if (fast_render) {
|
|
|
|
midi_in = 0;
|
|
|
|
interactive = 0;
|
|
|
|
with_server = 0;
|
|
|
|
fluid_settings_setstr(settings, "player.timing-source", "sample");
|
|
|
|
}
|
|
|
|
|
2003-03-11 16:56:45 +00:00
|
|
|
/* start the synthesis thread */
|
2009-04-25 15:17:15 +00:00
|
|
|
if (!fast_render) {
|
|
|
|
adriver = new_fluid_audio_driver(settings, synth);
|
|
|
|
if (adriver == NULL) {
|
|
|
|
fprintf(stderr, "Failed to create the audio driver\n");
|
|
|
|
goto cleanup;
|
|
|
|
}
|
2003-03-11 16:56:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* start the midi router and link it to the synth */
|
|
|
|
#if WITH_MIDI
|
|
|
|
if (midi_in) {
|
|
|
|
/* In dump mode, text output is generated for events going into and out of the router.
|
|
|
|
* The example dump functions are put into the chain before and after the router..
|
|
|
|
*/
|
2009-09-22 07:04:07 +00:00
|
|
|
//sequencer = new_fluid_sequencer2(0);
|
2003-04-03 21:32:56 +00:00
|
|
|
|
2003-03-11 16:56:45 +00:00
|
|
|
router = new_fluid_midi_router(
|
2007-03-04 16:45:05 +00:00
|
|
|
settings,
|
2009-09-22 07:04:07 +00:00
|
|
|
dump ? fluid_midi_dump_postrouter : fluid_synth_handle_midi_event,
|
|
|
|
(void*)synth);
|
2007-03-04 16:45:05 +00:00
|
|
|
|
2009-09-22 07:04:07 +00:00
|
|
|
if (router == NULL) {
|
2004-08-06 09:56:24 +00:00
|
|
|
fprintf(stderr, "Failed to create the MIDI input router; no MIDI input\n"
|
|
|
|
"will be available. You can access the synthesizer \n"
|
|
|
|
"through the console.\n");
|
2003-03-11 16:56:45 +00:00
|
|
|
} else {
|
|
|
|
fluid_synth_set_midi_router(synth, router); /* Fixme, needed for command handler */
|
2009-09-22 07:04:07 +00:00
|
|
|
// fluid_sequencer_register_fluidsynth(sequencer, synth);
|
2003-03-11 16:56:45 +00:00
|
|
|
mdriver = new_fluid_midi_driver(
|
2007-03-04 16:45:05 +00:00
|
|
|
settings,
|
2003-03-11 16:56:45 +00:00
|
|
|
dump ? fluid_midi_dump_prerouter : fluid_midi_router_handle_midi_event,
|
|
|
|
(void*) router);
|
|
|
|
if (mdriver == NULL) {
|
2004-08-06 09:56:24 +00:00
|
|
|
fprintf(stderr, "Failed to create the MIDI thread; no MIDI input\n"
|
|
|
|
"will be available. You can access the synthesizer \n"
|
|
|
|
"through the console.\n");
|
2003-03-11 16:56:45 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2009-05-14 23:59:30 +00:00
|
|
|
/* run commands specified in config file */
|
|
|
|
if (config_file != NULL) {
|
|
|
|
fluid_source(cmd_handler, config_file);
|
|
|
|
} else if (fluid_get_userconf(buf, 512) != NULL) {
|
|
|
|
fluid_source(cmd_handler, buf);
|
|
|
|
} else if (fluid_get_sysconf(buf, 512) != NULL) {
|
|
|
|
fluid_source(cmd_handler, buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2003-03-11 16:56:45 +00:00
|
|
|
/* play the midi files, if any */
|
|
|
|
for (i = arg1; i < argc; i++) {
|
|
|
|
if ((argv[i][0] != '-') && fluid_is_midifile(argv[i])) {
|
|
|
|
|
|
|
|
if (player == NULL) {
|
|
|
|
player = new_fluid_player(synth);
|
|
|
|
if (player == NULL) {
|
2004-08-06 09:56:24 +00:00
|
|
|
fprintf(stderr, "Failed to create the midifile player.\n"
|
|
|
|
"Continuing without a player.\n");
|
2003-03-11 16:56:45 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fluid_player_add(player, argv[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (player != NULL) {
|
|
|
|
fluid_player_play(player);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* run the server, if requested */
|
2009-10-12 19:18:06 +00:00
|
|
|
#if !defined(MACINTOSH)
|
2003-03-11 16:56:45 +00:00
|
|
|
if (with_server) {
|
|
|
|
server = new_fluid_server(settings, newclient, synth);
|
|
|
|
if (server == NULL) {
|
2004-08-06 09:56:24 +00:00
|
|
|
fprintf(stderr, "Failed to create the server.\n"
|
2003-03-11 16:56:45 +00:00
|
|
|
"Continuing without it.\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2006-02-19 10:01:58 +00:00
|
|
|
#ifdef LASH_ENABLED
|
|
|
|
if (enabled_lash)
|
|
|
|
fluid_lash_create_thread (synth);
|
|
|
|
#endif
|
2003-03-11 16:56:45 +00:00
|
|
|
|
|
|
|
/* run the shell */
|
|
|
|
if (interactive) {
|
|
|
|
print_welcome();
|
|
|
|
|
2006-02-19 10:01:58 +00:00
|
|
|
printf ("Type 'help' for information on commands and 'help help' for help topics.\n\n");
|
|
|
|
|
2003-03-11 16:56:45 +00:00
|
|
|
/* In dump mode we set the prompt to "". The UI cannot easily
|
|
|
|
* handle lines, which don't end with CR. Changing the prompt
|
|
|
|
* cannot be done through a command, because the current shell
|
|
|
|
* does not handle empty arguments. The ordinary case is dump ==
|
|
|
|
* 0.
|
|
|
|
*/
|
|
|
|
fluid_settings_setstr(settings, "shell.prompt", dump ? "" : "> ");
|
2007-03-04 16:45:05 +00:00
|
|
|
fluid_usershell(settings, cmd_handler);
|
2003-03-11 16:56:45 +00:00
|
|
|
}
|
|
|
|
|
2009-04-25 15:17:15 +00:00
|
|
|
if (fast_render) {
|
2009-10-19 05:41:07 +00:00
|
|
|
char *filename;
|
|
|
|
|
|
|
|
print_welcome ();
|
|
|
|
fluid_settings_dupstr (settings, "audio.file.name", &filename);
|
|
|
|
printf ("Rendering audio to file '%s'..\n", filename);
|
|
|
|
if (filename) FLUID_FREE (filename);
|
|
|
|
|
2009-04-25 15:17:15 +00:00
|
|
|
fast_render_loop(settings, synth, player);
|
|
|
|
}
|
|
|
|
|
2003-03-11 16:56:45 +00:00
|
|
|
cleanup:
|
|
|
|
|
|
|
|
#if !defined(MACINTOSH) && !defined(WIN32)
|
|
|
|
if (server != NULL) {
|
|
|
|
/* if the user typed 'quit' in the shell, kill the server */
|
|
|
|
if (!interactive) {
|
|
|
|
fluid_server_join(server);
|
|
|
|
}
|
|
|
|
delete_fluid_server(server);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (cmd_handler != NULL) {
|
|
|
|
delete_fluid_cmd_handler(cmd_handler);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (player != NULL) {
|
|
|
|
/* if the user typed 'quit' in the shell, stop the player */
|
|
|
|
if (interactive) {
|
|
|
|
fluid_player_stop(player);
|
2007-03-04 16:45:05 +00:00
|
|
|
}
|
2009-10-08 19:56:03 +00:00
|
|
|
if (adriver != NULL || !fluid_settings_str_equal(settings, "player.timing-source", "sample")) {
|
|
|
|
/* if no audio driver and sample timers are used, nothing makes the player advance */
|
|
|
|
fluid_player_join(player);
|
|
|
|
}
|
2003-03-11 16:56:45 +00:00
|
|
|
delete_fluid_player(player);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (router) {
|
|
|
|
#if WITH_MIDI
|
|
|
|
if (mdriver) {
|
|
|
|
delete_fluid_midi_driver(mdriver);
|
|
|
|
}
|
|
|
|
delete_fluid_midi_router(router);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2009-09-22 07:04:07 +00:00
|
|
|
/*if (sequencer) {
|
2009-06-04 20:41:15 +00:00
|
|
|
delete_fluid_sequencer(sequencer);
|
2009-09-22 07:04:07 +00:00
|
|
|
}*/
|
2009-06-04 20:41:15 +00:00
|
|
|
|
2003-03-11 16:56:45 +00:00
|
|
|
if (adriver) {
|
|
|
|
delete_fluid_audio_driver(adriver);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (synth) {
|
|
|
|
delete_fluid_synth(synth);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (settings) {
|
|
|
|
delete_fluid_settings(settings);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static fluid_cmd_handler_t* newclient(void* data, char* addr)
|
|
|
|
{
|
|
|
|
fluid_synth_t* synth = (fluid_synth_t*) data;
|
|
|
|
return new_fluid_cmd_handler(synth);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2003-03-12 00:58:20 +00:00
|
|
|
/*
|
|
|
|
* print_usage
|
|
|
|
*/
|
2007-03-04 16:45:05 +00:00
|
|
|
void
|
|
|
|
print_usage()
|
2003-03-11 16:56:45 +00:00
|
|
|
{
|
2006-02-19 10:01:58 +00:00
|
|
|
print_welcome ();
|
|
|
|
fprintf(stderr, "Usage: fluidsynth [options] [soundfonts]\n");
|
2004-08-06 09:56:24 +00:00
|
|
|
fprintf(stderr, "Try -h for help.\n");
|
2003-03-11 16:56:45 +00:00
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
|
2003-03-12 00:58:20 +00:00
|
|
|
/*
|
|
|
|
* print_welcome
|
|
|
|
*/
|
2007-03-04 16:45:05 +00:00
|
|
|
void
|
|
|
|
print_welcome()
|
2003-03-11 16:56:45 +00:00
|
|
|
{
|
2006-02-19 10:01:58 +00:00
|
|
|
printf("FluidSynth version %s\n"
|
2009-04-25 15:17:15 +00:00
|
|
|
"Copyright (C) 2000-2009 Peter Hanappe and others.\n"
|
2006-02-19 10:01:58 +00:00
|
|
|
"Distributed under the LGPL license.\n"
|
|
|
|
"SoundFont(R) is a registered trademark of E-mu Systems, Inc.\n\n",
|
|
|
|
FLUIDSYNTH_VERSION);
|
2003-03-11 16:56:45 +00:00
|
|
|
}
|
|
|
|
|
2003-03-12 00:58:20 +00:00
|
|
|
/*
|
|
|
|
* print_help
|
|
|
|
*/
|
2007-03-04 16:45:05 +00:00
|
|
|
void
|
|
|
|
print_help()
|
2003-03-11 16:56:45 +00:00
|
|
|
{
|
2009-05-09 14:51:22 +00:00
|
|
|
char allnames[256];
|
2006-02-19 10:01:58 +00:00
|
|
|
print_welcome ();
|
2003-03-11 16:56:45 +00:00
|
|
|
printf("Usage: \n");
|
|
|
|
printf(" fluidsynth [options] [soundfonts] [midifiles]\n");
|
|
|
|
printf("Possible options:\n");
|
2009-05-09 14:51:22 +00:00
|
|
|
fluid_audio_driver_get_names(allnames, sizeof(allnames), ", ");
|
2003-03-11 16:56:45 +00:00
|
|
|
printf(" -a, --audio-driver=[label]\n"
|
2009-05-09 14:51:22 +00:00
|
|
|
" The name of the audio driver to use.\n"
|
|
|
|
" Valid values: %s\n", allnames);
|
2006-02-19 10:01:58 +00:00
|
|
|
printf(" -c, --audio-bufcount=[count]\n"
|
|
|
|
" Number of audio buffers\n");
|
2009-10-03 18:12:19 +00:00
|
|
|
printf(" -C, --chorus\n"
|
|
|
|
" Turn the chorus on or off [0|1|yes|no, default = on]\n");
|
2006-02-19 10:01:58 +00:00
|
|
|
printf(" -d, --dump\n"
|
|
|
|
" Dump incoming and outgoing MIDI events to stdout\n");
|
2009-10-03 18:12:19 +00:00
|
|
|
printf(" -E, --audio-file-endian\n"
|
|
|
|
" Audio file endian for fast rendering or aufile driver (\"help\" for list)\n");
|
2006-02-19 10:01:58 +00:00
|
|
|
printf(" -f, --load-config\n"
|
|
|
|
" Load command configuration file (shell commands)\n");
|
2009-10-03 18:12:19 +00:00
|
|
|
printf(" -F, --fast-render=[file]\n"
|
|
|
|
" Render MIDI file to raw audio data and store in [file]\n");
|
2003-03-11 16:56:45 +00:00
|
|
|
printf(" -g, --gain\n"
|
2006-02-19 10:01:58 +00:00
|
|
|
" Set the master gain [0 < gain < 10, default = 0.2]\n");
|
2009-10-03 18:12:19 +00:00
|
|
|
printf(" -G, --audio-groups\n"
|
|
|
|
" Defines the number of LADSPA audio nodes\n");
|
2006-02-19 10:01:58 +00:00
|
|
|
printf(" -h, --help\n"
|
|
|
|
" Print out this help summary\n");
|
|
|
|
printf(" -i, --no-shell\n"
|
|
|
|
" Don't read commands from the shell [default = yes]\n");
|
|
|
|
printf(" -j, --connect-jack-outputs\n"
|
|
|
|
" Attempt to connect the jack outputs to the physical ports\n");
|
|
|
|
printf(" -K, --midi-channels=[num]\n"
|
|
|
|
" The number of midi channels [default = 16]\n");
|
|
|
|
#ifdef LASH_ENABLED
|
|
|
|
printf(" -l, --disable-lash\n"
|
|
|
|
" Don't connect to LASH server\n");
|
2003-08-26 05:04:20 +00:00
|
|
|
#endif
|
2009-10-03 18:12:19 +00:00
|
|
|
printf(" -L, --audio-channels=[num]\n"
|
|
|
|
" The number of stereo audio channels [default = 1]\n");
|
2009-05-09 14:51:22 +00:00
|
|
|
fluid_midi_driver_get_names(allnames, sizeof(allnames), ", ");
|
2006-02-19 10:01:58 +00:00
|
|
|
printf(" -m, --midi-driver=[label]\n"
|
2009-05-09 14:51:22 +00:00
|
|
|
" The name of the midi driver to use.\n"
|
|
|
|
" Valid values: %s\n", allnames);
|
2006-02-19 10:01:58 +00:00
|
|
|
printf(" -n, --no-midi-in\n"
|
|
|
|
" Don't create a midi driver to read MIDI input events [default = yes]\n");
|
2003-03-11 16:56:45 +00:00
|
|
|
printf(" -o\n"
|
2006-02-19 10:01:58 +00:00
|
|
|
" Define a setting, -o name=value (\"-o help\" to dump current values)\n");
|
2009-10-03 18:12:19 +00:00
|
|
|
printf(" -O, --audio-file-format\n"
|
|
|
|
" Audio file format for fast rendering or aufile driver (\"help\" for list)\n");
|
|
|
|
printf(" -p, --portname=[label]\n"
|
|
|
|
" Set MIDI port name (alsa_seq, coremidi drivers)\n");
|
2006-02-19 10:01:58 +00:00
|
|
|
printf(" -r, --sample-rate\n"
|
|
|
|
" Set the sample rate\n");
|
2009-10-03 18:12:19 +00:00
|
|
|
printf(" -R, --reverb\n"
|
|
|
|
" Turn the reverb on or off [0|1|yes|no, default = on]\n");
|
2006-02-19 10:01:58 +00:00
|
|
|
printf(" -s, --server\n"
|
|
|
|
" Start FluidSynth as a server process\n");
|
2009-10-03 18:12:19 +00:00
|
|
|
printf(" -T, --audio-file-type\n"
|
|
|
|
" Audio file type for fast rendering or aufile driver (\"help\" for list)\n");
|
2006-02-19 10:01:58 +00:00
|
|
|
printf(" -v, --verbose\n"
|
|
|
|
" Print out verbose messages about midi events\n");
|
2009-10-03 18:12:19 +00:00
|
|
|
printf(" -V, --version\n"
|
|
|
|
" Show version of program\n");
|
2006-02-19 10:01:58 +00:00
|
|
|
printf(" -z, --audio-bufsize=[size]\n"
|
|
|
|
" Size of each audio buffer\n");
|
2003-03-11 16:56:45 +00:00
|
|
|
exit(0);
|
|
|
|
}
|