Skip to content

Commit

Permalink
adding scales
Browse files Browse the repository at this point in the history
  • Loading branch information
heuermh committed Nov 19, 2012
1 parent 42ada73 commit 85b63aa
Show file tree
Hide file tree
Showing 3 changed files with 563 additions and 1 deletion.
45 changes: 45 additions & 0 deletions Scale.ck
@@ -0,0 +1,45 @@
/*
LiCK Library for ChucK.
Copyright (c) 2007-2012 held jointly by the individual authors.
This file is part of LiCK.
LiCK is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
LiCK is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with LiCK. If not, see <http://www.gnu.org/licenses/>.
*/

public class Scale
{
"Scale" => string name;
"Scale" => string description;
0.0 => float root;
ArrayList intervals;
Intervals.unison() @=> Interval unison;

fun void forEach(FloatProcedure procedure)
{
procedure.run(root);
}

fun float sample()
{
return sampleInterval().evaluate(root);
}

fun Interval sampleInterval()
{
return unison;
}
}

0 comments on commit 85b63aa

Please sign in to comment.