Code and usage for stk::Feadóg (penny-whistle)
Jump to: [ Installation ] [ Usage ] [ Scores ] [ Project main page ]Installation
[ Download code ]To start, make sure you've installed the Synthesis ToolKit in C++ (STK).
This zip file contains two folders: "new_files" and "modified_stk_files." Because STK already contains both whistle and flute classes, the penny-whistle class is called Feadog, as feadóg means whistle in Irish.
From the "new_files" directory, compile with the following (after changing the -L and -I paths to match your STK installation):
g++ -D__MACOSX_CORE__ -L/.../stk-4.4.3/src -I/.../stk-4.4.3/include/ -o play_whistle play_whistle.cpp Feadog.cpp -lstk -lpthread -framework CoreAudio -framework CoreMIDI -framework CoreFoundation
To make use of the STK demo programs, see below.
Usage
From the "new_files" directory:
./play_whistle scores/ [-w ] [-h <#> <#> <#> <#> <#> <#>]
scorefile
is a SKINI score file. For included scores, see below; read about the SKINI (Synthesis ToolKit Instrument Network Interface) format here.- The optional "-w #" flag indicates a whistle-type preset: "-w 1" is a low whistle; "-w 2" is a high whistle; any other integer will default to high whistle-type body. More presets may be added in the future.
- The optional "-h" flag sets the hole spacing on the cylindrical body. The following list of six numbers are the (distance between each hole and its adjacent hole) over the length of the whistle and must sum to less than 1. For example, the first # is just the distance from the mouthpiece to the first hole over the length of the flute, the second number is the distance from the first hole to the second hole divided by the length of the flute, the third is the distance from the second to the third holes divided by the length of the flute, etc.
If both the "-w" and "-h" flags are used, the hole spacing is applied to the instrument of build -w (hole radius, bore radius, cylinder length). Otherwise, a high whistle body is assumed.
Examples
- Try
./play_whistle scores/feadogtest.ski -w 2
and compare with./play_whistle scores/feadogtest.ski -w 2 -h .27 .0481 .04 .0755 .01 .0808
- Low whistle, slower piece:
./play_whistle scores/slow_demo.ski -w 1
- High whistle, faster piece:
./play_whistle scores/fast_demo.ski -w 0
- High whistle:
./play_whistle scores/last_demo.ski
STK "Demo" functionality
To play with the penny-whistle from the demo classes, which allow both SKINI and MIDI input/output (realtime and otherwise) and an interface to tweak various instrument parameters, a few more (easy!) installation steps are required.
From the "new_files" directory:
- Copy "Feadog.cpp" to the STK
src/
directory; - Copy "Feadog.h" to the STK
include/
directory; - Copy the files in "scores" to the STK
projects/demo/scores
directory.
Replace the following STK files with their modified versions in "modified_stk_files":
projects/demo/tcl/Demo.tcl
projects/demo/utilities.cpp
project/demo/Makefile.in
In the main STK directory, run ./configure
; in the stk/projects/demos directory, run make clean
and then make
. Now "Feadog" is available as an instrument choice in both the ./demo
and ./StkDemo
examples! For additional instructions on using these demo examples, see the official STK usage page.
Sample SKINI files
The "scores" folder contains the following melodies, complete with expressive fingering speed adjustments; slow_demo.ski, fast_demo.ski, and last_demo.ski. In addition, the file scales_demo.ski is included; it runs through a major scale, one octave, at three speeds: slow, medium, and fast. Good for testing different hole spacing to check tuning. Because the MIDI note numbers in a SKINI file refer to fingerings on the whistle, these scales play from "all holes closed" to "all holes open" rather than from specific pitch to specific pitch. This means the tuning of the whistle effects the tuning of this file, making it a good file with which to test different hole spacings.
[ Top ]