Permalink
Browse files

Added -p option to ui.py (alias sf2a).

  • Loading branch information...
1 parent 638ac84 commit 44927de83afcfc01e575f946f691448b0d34ec52 James Carlson committed Apr 15, 2011
Showing with 25 additions and 1 deletion.
  1. +21 −1 manual/sf2a.tex
  2. +4 −0 ui.py
View
@@ -172,11 +172,31 @@ \subsection{Playing an audio file}
\end{verbatim}
We will assume the existence of such a command.
-\subsection{Producing an audio file}
+\subsection{Producing an audio file with {\tt sf2a}}
Use {\tt sf2a 'do re mi'} to produce a {\tt .wav} file, {\tt out.wav}
representing this melody.
+
+ -h, --help show this help message and exit
+ -f FILENAME, --file=FILENAME
+ -o OUTPUT, --output=OUTPUT
+ -s SCALE, --scale=SCALE
+
+
+\begin{description}
+
+\item[ -h, --help] Display help.
+
+\item[ -f, --filename] Take input from file: {\tt sf2a -h mymelody}/
+
+\item[o, --output] As in {\tt sf2a 'do re mi' -o foo}, write
+output to {\tt foo.wav}.
+
+\item[-s, -scale] As in {\tt sf2a 'do re mi' --scale diatonic}
+or {\tt sf2a 'do re mi' --scale chromatic}, select scale. Default is XXXX.
+
+\end{description}
\subsection{mtalk}
The {\tt mtalk} program converts text into an audio file by converting
View
4 ui.py
@@ -10,6 +10,7 @@
parser.add_option("-f", "--file", action="store", type="string", dest="filename")
parser.add_option("-o", "--output", action="store", type="string", dest="output")
parser.add_option("-s", "--scale", action="store", type="string", dest="scale")
+parser.add_option("-p", "--play", action="store_true", dest="play")
(options, args) = parser.parse_args()
@@ -31,3 +32,6 @@
run(input, output, SCALE)
+
+if options.play:
+ cmd = "play " + output + ".wav"

0 comments on commit 44927de

Please sign in to comment.