Skip to content

Commit

Permalink
non-linear volume
Browse files Browse the repository at this point in the history
  • Loading branch information
abramhindle committed Nov 9, 2012
1 parent da5c88e commit fe8d984
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
6 changes: 5 additions & 1 deletion KinectCVShape.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ void DrawScene()
//warpAffine(segment, ourLine, rot_mat, segment.size());
//double x = ourLine.at<double>(0,0);
//double y = ourLine.at<double>(1,0);
line( dst, Point2f(WIDTH/2, HEIGHT/2), Point2f(WIDTH/2 + xprime, HEIGHT/2 + yprime), Scalar(0,0,255));
line( dst, Point2f(WIDTH/2, HEIGHT/2), Point2f(WIDTH/2 + xprime, HEIGHT/2 + yprime), Scalar(0,0,255), 4);
//line( dst, Point2f(segment.row(0)), Point2f(ourLine.row(0)), Scalar(0,0,255));


Expand Down Expand Up @@ -836,6 +836,10 @@ int main(int argc, char **argv)
exit(0);
} else if (e.key.keysym.sym == SDLK_ESCAPE) { //Escape
exit(0);
} else if (e.key.keysym.sym == 'k') {
gtempo--;
} else if (e.key.keysym.sym == 'l') {
gtempo++;
} else if (e.key.keysym.sym == 'h') {
gthreshold=(gthreshold>1024-10)?1024:(gthreshold+10);
} else if (e.key.keysym.sym == 'j') {
Expand Down
7 changes: 6 additions & 1 deletion vocode.pl
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,17 @@
# cs("\"GBEGAmpSet\"" ,0,0, 0.01*$amp ) ;
#}
my $index = 0;
sub scaleSample {
my $sample = shift;
my $s = ($sample - 300);
return ((2048-300) - $s)/(2048-300);
}
foreach my $sample (@{$h->{samples}}) {
#if ($sample >= 300) {
#cs('666', rand(0.1),1, $index, ($sample >= 300)?100*(2048-($sample-300))/2048.0:0, 20*($index + 1));
#}
if ($sample >= 300) {
cs('777', rand(0.1),0.1, $index, ($sample >= 300)?300*(2048-($sample-300))/2048.0:0, 40+exp(1.0+$index/12.0));#10*($index + 1));
cs('777', rand(0.1),0.1, $index, exp(5*scaleSample($sample)), 40+exp(1.0+$index/12.0));#10*($index + 1));
}
$index++;
}
Expand Down

0 comments on commit fe8d984

Please sign in to comment.