Menu

Command Line Options

sduplichan

The order of ctune command line options usually doesn't matter. One exception is when an option name is duplicated. In this case, the rightmost occurrence overrides instances to the left. If an option isn't recognized, ctune will assume it's an input wave file name.

Many options are experimental, or for debug use, or not functional at all. These will be listed last or not at all.

For a summary of all options along with there current settings, execute ctune help.

To confirm an option is being parsed as intended, append help to the end of the command. For example, executing ctune maxfreq=100000 help prints:
maxfreq= set filter bank highest frequency [22050.00]

This shows that the value 100000 wasn't accepted (it's too big for the current sample rate).


a4ref=value
For tuner mode, this option overrides the default A4 tuning reference value of 440 Hz. For midi generation mode, this value overrides the measured A4 tuning reference value.


transpose=value
Adjust concert semitone value by this amount before displaying a note name.


midi
This option enables midi generation mode with instrument selection value 0 (grand piano). The option is normally used with audio file input. The midi file is not generated until the app exits.


midi=value
If value starts with a decimal digit, then value is treated as a numeric midi instrument selection code. Otherwise value is an instrument name. Accepted midi names are listed at line 159 of file app\midi.c


wave=myWaveFile.wav,\[channel]
For audio file input mode only. Set the path and file name for the input audio file. The optional channel selects the 0 relative wave file channel number when a the input file has multiple channels. If omitted, channel 0 is used.

The input file can be passed on the command line without the wave= prefix. This is a useful shortcut when the channel number is not needed.

In addition to wav files, aiff, flac, mp3, ogg, htk, caf, fap, pvf, w64, and snd file formats are supported.


wavespeed=value

Acceleration factor when processing input from an audio file. Use 0 to process at maximum speed. Other values scale the processing speed relative to the input file normal playback speed. So value 1 gives normal speed. Value 0.1 slows down playback 10X. Value 2 doubles playback speed. The default for tuner mode is 1. The default for other modes is 0.


skipahead=value

When audio input if from a file, skip ahead in the audio file by this much time. Value is floating point in seconds.


minnoteduration=value
When generating a midi file, detected notes shorter than this value will be omitted. Value is a floating point time value in seconds.


onsetenable=value
When generating a midi file, this option controls the separation of back to back notes of the same pitch. A value of 0 disables separation of same pitch notes. A value of 1 maximizes separation of same pitch notes. Value is a floating point number between 0 and 1.


minpowergain=value
This option controls multiphonic tone detection. A value of 1 maximizes multiphonic tone detection. The default value of 1.5 nearly eliminates multiphonic tone detection. The actual value is the ratio of total RMS power with the new tone to the total RMS power without the new tone.


chromaticoverlap=value
The default value of 1 triggers special handling of overlapping notes that are 1 or 2 semitones apart. When a short note is completely overlapped by a longer note, the longer note is split. Partial overlaps are limited to 40 ms. Set this option to 0 to disable it. Use option notedebug=11 to log its activity.


scroll=value
Sets the rate in frames per second at which filter bank snapshots are captured and processed. The default value of 100 is typical for audio processing software. A larger value such as 200 is useful for capturing very short notes and trills. A value such as 1000 can be used along with wavespeed= to view the waveform in slow motion.


maxscrollchunk=value
This option controls the smoothness of the lower pane scrolling when data is produced faster than it can be displayed. The default value of .20 results in a 20% shift of the view for each screen update. This default minimizes video overhead, but results in a jerky scrolling appearance. Use a smaller value to smooth the scrolling at a slight expense to performance.


maxnotedropout=value
When generating a midi file, this option controls the maximum time in seconds that a detected tone can drop out without ending the note in progress.


maxmissingchunk=value
Set limit for the ratio of biggest missing chunk to note duration. Default is 0.25.


exit
For audio file input mode only. Exit after processing the input audio file.


exit=value
For audio file input mode only. Exit after running this amount of time. Value is a floating point time value in seconds.


pause

For audio file input mode only. Pause after processing the input audio file. After the playback pauses, uncheck the pause box to continue playback in loop mode.


pause=value

For audio file input mode only. Pause after processing this much of the input audio file. Uncheck the pause box to continue playback in loop mode. Value is seconds in floating point.


size=width,height
Set a target size in pixels for the main display window. The width may be modified slightly to minimize display interpolation.


hsplitter=value

Set ratio of upper pane to whole window. Value is a floating point [0,1].


keepconsole=value

The default value of 1 keeps the debug console window open. If keepconsole is set to 0, the app will close the debug console window after starting up


gain0=highValue,lowValue
gain1=highValue,lowValue
gain=highValue,lowValue

Disable automatic gain control and manually set the gain high and low values for the upper pane, lower pane, or both panes. Values are dB in floating point and the sign is inverted to simplify typing.


minfreq=value
maxfreq=value

Override the filter bank default starting and ending frequencies. Values are Hz in floating point. Setting minfreq to a value no lower than needed is a good way to reduce false tone detection and increase efficiency. Be careful when limiting maxfreq because this can reduce visibility of high harmonics needed to reliably detect high notes. If you want to eliminate note detection above a frequency threshold, use f0max=.


f0min=value
f0max=value

Limit f0 detection frequency range. Values are Hz in floating point. To limit detection of low frequency notes, minfreq= is a better choice.


zoom=low,high

This option affects the display only and not the filter bank. Zooms the display frequency range to the low,high range. Values are Hz in floating point.


freqscale=[log or linear]

Sets the filter bank frequency assignment method. Default is log. Use linear with caution, as it is not fully validated and the program may contain hard coded assumptions about frequency scale log.


qtype=[constantq or constantbw or log or loglog or power]
qlow=value
qhigh=value
qlowfreq=value
qhighfreq=value

plots

qtype Q equation
constantq Q = qlow
constantbw Q = qlow * frequency / qlowfreq
log (see desmos plot)

bpfstages=value

Number of cascaded IIR stages in the band pass portion of each filter bank element. Integer, default 2.


pwrlpffreq=value
This option sets the cutoff frequency of the low pass filter portion of each filter bank element. When this option is in effect, all filter bank elements use an identical low pass filter. Exception: the pwrlpfmincycles option described below overrides this setting for low frequency elements.


pwrlpfmincycles=value
This option limits the maximum cutoff frequency of the low pass filter portion of each filter bank element. If the cutoff frequency to be assigned to a filter bank element has a period that is less than this number of cycles of the corresponding band pass filter center frequency, then the low pass filter cutoff frequency is adjusted to meet this minimum cycle requirement. This setting affects only the lower frequency portion of the filter bank.


lpfCutoffCyclesvalue
This option overrides the normal scheme of using a fixed low pass cutoff frequency for each filter element. When this option is in effect, the cutoff frequency for each filter bank element is set according to the center frequency of the corresponding filter bank band pass filter. The low pass cutoff frequency is set to match the number of band pass center frequency cycles given by this option. This option is off by default because it is more suitable for data than for music.


pwrlpfselect=value

power LPF option (combobox index). Integer, default 14 (EMA 6 stage)

 0 passthrough
 1 IIR 1 stage
 2 IIR 2 stage
 3 IIR 3 stage
 8 IIR 8 stage
 4 IIR 4 stage
 5 IIR 5 stage
 6 IIR 6 stage
 7 IIR 7 stage
 1 IIR 9 stage
10 IIR 10 stage
11 EMA 1 stage
12 EMA 2 stage
13 EMA 4 stage
14 EMA 6 stage
15 EMA 8 stage
16 EMA 10 stage
17 EMA 12 stage
18 EMA 14 stage
19 EMA 16 stage
20 EMA 18 stage
21 EMA 20 stage

threads=value

Number of filter bank processing threads. Integer, default is max available. The filter threads run once per frame and apply all the new audio samples to the filter bank elements.


snapshotthreads=value

Number of snapshot processing threads. Integer, default is 1/4 of max available. The snapshot threads run once per frame and calculate the likelihood of a harmonic series for each filter element frequency in the [f0min,f0max] range.


Related

Wiki: Home