mirror of
https://github.com/thestk/stk
synced 2026-01-11 20:11:52 +00:00
Version 4.4.4
This commit is contained in:
committed by
Stephen Sinclair
parent
0aec39260a
commit
fc877b87bf
@@ -8,9 +8,9 @@ OBJECT_PATH = @object_path@
|
||||
vpath %.o $(OBJECT_PATH)
|
||||
|
||||
OBJECTS = Stk.o Generator.o Envelope.o SineWave.o \
|
||||
Filter.o Delay.o DelayL.o \
|
||||
Effect.o Echo.o PitShift.o Chorus.o \
|
||||
PRCRev.o JCRev.o NRev.o \
|
||||
Filter.o Delay.o DelayL.o OnePole.o \
|
||||
Effect.o Echo.o PitShift.o Chorus.o LentPitShift.o \
|
||||
PRCRev.o JCRev.o NRev.o FreeVerb.o \
|
||||
FileRead.o WvIn.o FileWvIn.o WaveLoop.o Skini.o Messager.o
|
||||
|
||||
INCLUDE = @include@
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
The Synthesis ToolKit in C++ (STK)
|
||||
|
||||
By Perry R. Cook and Gary P. Scavone, 1995-2011.
|
||||
By Perry R. Cook and Gary P. Scavone, 1995-2012.
|
||||
|
||||
EFFECTS PROJECT:
|
||||
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
#include "PRCRev.h"
|
||||
#include "JCRev.h"
|
||||
#include "NRev.h"
|
||||
#include "FreeVerb.h"
|
||||
#include "Echo.h"
|
||||
#include "PitShift.h"
|
||||
//#include "LentPitShift.h"
|
||||
#include "LentPitShift.h"
|
||||
#include "Chorus.h"
|
||||
#include "Messager.h"
|
||||
#include "RtAudio.h"
|
||||
@@ -41,9 +42,10 @@ struct TickData {
|
||||
PRCRev prcrev;
|
||||
JCRev jcrev;
|
||||
NRev nrev;
|
||||
FreeVerb frev;
|
||||
Echo echo;
|
||||
PitShift shifter;
|
||||
//LentPitShift shifter;
|
||||
LentPitShift lshifter;
|
||||
Chorus chorus;
|
||||
Envelope envelope;
|
||||
Messager messager;
|
||||
@@ -101,25 +103,29 @@ void processMessage( TickData* data )
|
||||
|
||||
case 22: // effect parameter change 1
|
||||
data->echo.setDelay( (unsigned long) (temp * Stk::sampleRate() * 0.95) );
|
||||
// data->shifter.setShift( temp * 3 + 0.25);
|
||||
data->shifter.setShift( 1.4 * temp + 0.3);
|
||||
data->lshifter.setShift( 1.4 * temp + 0.3 );
|
||||
data->shifter.setShift( 1.4 * temp + 0.3 );
|
||||
data->chorus.setModFrequency( temp );
|
||||
data->prcrev.setT60( temp * 10.0 );
|
||||
data->jcrev.setT60( temp * 10.0 );
|
||||
data->nrev.setT60( temp * 10.0 );
|
||||
data->frev.setDamping( temp );
|
||||
break;
|
||||
|
||||
case 23: // effect parameter change 2
|
||||
data->chorus.setModDepth( temp * 0.2 );
|
||||
data->frev.setRoomSize( temp );
|
||||
break;
|
||||
|
||||
case 44: // effect mix
|
||||
data->echo.setEffectMix( temp );
|
||||
data->shifter.setEffectMix( temp );
|
||||
data->lshifter.setEffectMix( temp );
|
||||
data->chorus.setEffectMix( temp );
|
||||
data->prcrev.setEffectMix( temp );
|
||||
data->jcrev.setEffectMix( temp );
|
||||
data->nrev.setEffectMix( temp );
|
||||
data->frev.setEffectMix( temp );
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -165,31 +171,37 @@ int tick( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames,
|
||||
counter = min( nTicks, data->counter );
|
||||
data->counter -= counter;
|
||||
for ( i=0; i<counter; i++ ) {
|
||||
if ( data->effectId < 2 ) { // Echo and PitShift ... mono output
|
||||
if ( data->effectId < 3 ) { // Echo, PitShift and LentPitShift ... mono output
|
||||
if ( data->effectId == 0 )
|
||||
sample = data->envelope.tick() * data->echo.tick( *iSamples++ );
|
||||
else
|
||||
else if ( data->effectId == 1 )
|
||||
sample = data->envelope.tick() * data->shifter.tick( *iSamples++ );
|
||||
else
|
||||
sample = data->envelope.tick() * data->lshifter.tick( *iSamples++ );
|
||||
*oSamples++ = sample; // two channels interleaved
|
||||
*oSamples++ = sample;
|
||||
}
|
||||
else { // Chorus or a reverb ... stereo output
|
||||
if ( data->effectId == 2 ) {
|
||||
if ( data->effectId == 3 ) {
|
||||
data->chorus.tick( *iSamples++ );
|
||||
effect = (Effect *) &(data->chorus);
|
||||
}
|
||||
else if ( data->effectId == 3 ) {
|
||||
else if ( data->effectId == 4 ) {
|
||||
data->prcrev.tick( *iSamples++ );
|
||||
effect = (Effect *) &(data->prcrev);
|
||||
}
|
||||
else if ( data->effectId == 4 ) {
|
||||
else if ( data->effectId == 5 ) {
|
||||
data->jcrev.tick( *iSamples++ );
|
||||
effect = (Effect *) &(data->jcrev);
|
||||
}
|
||||
else {
|
||||
else if ( data->effectId == 6 ) {
|
||||
data->nrev.tick( *iSamples++ );
|
||||
effect = (Effect *) &(data->nrev);
|
||||
}
|
||||
else {
|
||||
data->frev.tick( *iSamples++ );
|
||||
effect = (Effect *) &(data->frev);
|
||||
}
|
||||
const StkFrames& samples = effect->lastFrame();
|
||||
*oSamples++ = data->envelope.tick() * samples[0];
|
||||
*oSamples++ = data->envelope.lastOut() * samples[1];
|
||||
|
||||
@@ -134,6 +134,14 @@ SOURCE=..\..\include\Envelope.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\OnePole.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\OnePole.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FileRead.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -190,6 +198,14 @@ SOURCE=..\..\include\NRev.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\FreeVerb.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\FreeVerb.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\PitShift.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
@@ -198,6 +214,14 @@ SOURCE=..\..\include\PitShift.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\LentPitShift.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\include\LentPitShift.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=..\..\src\PRCRev.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
@@ -80,21 +80,27 @@ radiobutton .effectSelect.echo -text "Echo" -variable effect -relief flat \
|
||||
-value 0 -command {changeEffect "ControlChange 0.0 1 " 20 $effect}
|
||||
radiobutton .effectSelect.shifter -text "Pitch Shift" -variable effect -relief flat \
|
||||
-value 1 -command {changeEffect "ControlChange 0.0 1 " 20 $effect}
|
||||
radiobutton .effectSelect.lshifter -text "Lent Pitch Shift" -variable effect -relief flat \
|
||||
-value 2 -command {changeEffect "ControlChange 0.0 1 " 20 $effect}
|
||||
radiobutton .effectSelect.chorus -text "Chorus" -variable effect -relief flat \
|
||||
-value 2 -command {changeEffect "ControlChange 0.0 1 " 20 $effect}
|
||||
radiobutton .effectSelect.prcrev -text "PRC Reverb" -variable effect -relief flat \
|
||||
-value 3 -command {changeEffect "ControlChange 0.0 1 " 20 $effect}
|
||||
radiobutton .effectSelect.jcrev -text "JC Reverb" -variable effect -relief flat \
|
||||
radiobutton .effectSelect.prcrev -text "PRC Reverb" -variable effect -relief flat \
|
||||
-value 4 -command {changeEffect "ControlChange 0.0 1 " 20 $effect}
|
||||
radiobutton .effectSelect.nrev -text "NRev Reverb" -variable effect -relief flat \
|
||||
radiobutton .effectSelect.jcrev -text "JC Reverb" -variable effect -relief flat \
|
||||
-value 5 -command {changeEffect "ControlChange 0.0 1 " 20 $effect}
|
||||
radiobutton .effectSelect.nrev -text "NRev Reverb" -variable effect -relief flat \
|
||||
-value 6 -command {changeEffect "ControlChange 0.0 1 " 20 $effect}
|
||||
radiobutton .effectSelect.freerev -text "FreeVerb" -variable effect -relief flat \
|
||||
-value 7 -command {changeEffect "ControlChange 0.0 1 " 20 $effect}
|
||||
|
||||
pack .effectSelect.echo -pady 2 -padx 5 -side top -anchor w -fill x
|
||||
pack .effectSelect.shifter -pady 2 -padx 5 -side top -anchor w -fill x
|
||||
pack .effectSelect.lshifter -pady 2 -padx 5 -side top -anchor w -fill x
|
||||
pack .effectSelect.chorus -pady 2 -padx 5 -side top -anchor w -fill x
|
||||
pack .effectSelect.prcrev -pady 2 -padx 5 -side top -anchor w -fill x
|
||||
pack .effectSelect.jcrev -pady 2 -padx 5 -side top -anchor w -fill x
|
||||
pack .effectSelect.nrev -pady 2 -padx 5 -side top -anchor w -fill x
|
||||
pack .effectSelect.freerev -pady 2 -padx 5 -side top -anchor w -fill x
|
||||
|
||||
|
||||
proc myExit {} {
|
||||
@@ -131,18 +137,22 @@ proc changeEffect {tag value1 value2 } {
|
||||
.left.effect1 config -state normal -label "Echo Delay"
|
||||
.left.effect2 config -state disabled -label "Disabled"
|
||||
}
|
||||
if ($value2==1) {
|
||||
if {$value2>=1 && $value2<=2} {
|
||||
.left.effect1 config -state normal -label "Pitch Shift Amount (center = no shift)"
|
||||
.left.effect2 config -state disabled -label "Disabled"
|
||||
}
|
||||
if ($value2==2) {
|
||||
if ($value2==3) {
|
||||
.left.effect1 config -state normal -label "Chorus Modulation Frequency"
|
||||
.left.effect2 config -state normal -label "Chorus Modulation Depth"
|
||||
}
|
||||
if {$value2>=3 && $value2<=5} {
|
||||
if {$value2>=4 && $value2<=6} {
|
||||
.left.effect1 config -state normal -label "T60 Decay Time ( 0 - 10 seconds)"
|
||||
.left.effect2 config -state disabled -label "Disabled"
|
||||
}
|
||||
if ($value2==7) {
|
||||
.left.effect1 config -state normal -label "Damping (low to high)"
|
||||
.left.effect2 config -state normal -label "Room Size (comb feedback gain)"
|
||||
}
|
||||
puts $outID [format "%s %i %f" $tag $value1 $value2]
|
||||
flush $outID
|
||||
}
|
||||
@@ -215,5 +225,32 @@ proc setComm {} {
|
||||
}
|
||||
}
|
||||
|
||||
bind . <Configure> {+ center_the_toplevel %W }
|
||||
proc center_the_toplevel { w } {
|
||||
|
||||
# Callback on the <Configure> event for a toplevel
|
||||
# that should be centered on the screen
|
||||
|
||||
# Make sure that we aren't configuring a child window
|
||||
if { [string equal $w [winfo toplevel $w]] } {
|
||||
|
||||
# Calculate the desired geometry
|
||||
set width [winfo reqwidth $w]
|
||||
set height [winfo reqheight $w]
|
||||
set x [expr { ( [winfo vrootwidth $w] - $width ) / 2 }]
|
||||
set y [expr { ( [winfo vrootheight $w] - $height ) / 2 }]
|
||||
#set y 0
|
||||
|
||||
# Hand the geometry off to the window manager
|
||||
wm geometry $w ${width}x${height}+${x}+${y}
|
||||
|
||||
# Unbind <Configure> so that this procedure is
|
||||
# not called again when the window manager finishes
|
||||
# centering the window. Also, revert geometry management
|
||||
# to internal default for subsequent size changes.
|
||||
bind $w <Configure> {}
|
||||
wm geometry $w ""
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user