Skip to content

Instantly share code, notes, and snippets.

Created September 8, 2014 20:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save anonymous/78e9d8368149c9bc6dd6 to your computer and use it in GitHub Desktop.
Save anonymous/78e9d8368149c9bc6dd6 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// Sass (v3.4.3)
// Compass (v1.0.1)
// ----
$notes:47;
//just cuz sass doesnt have enough math
@function expo($base,$exponent){
$value:$base;
@for $i from 1 through $exponent {
$value:$value*$base;
}
@return $value;
}
//the function that can give me notes in HZ
@function octarray($n){
$myarray:1;
//that loop below
@for $i from 1 through $n{
$myarray:append($myarray,expo(105958,$i)/expo(100000,$i));
//must use large number and deeevid because sass is stupid in maths and needs integers
}
$lastone: length($myarray);
//variable that knows what n i stopped at, even though it could be equal to $n, should it? whatever this works
@return nth($myarray,$lastone);
//the last value in the array, because the function will be used this way gee
}
//this is not how it will actually work, but is an example
#mydiv{
width:octarray(12);
}
//this is to make sure the loop itself gives me what i want
@for $i from 1 through $notes{
.cols-#{$i}{
width: 1* expo(105958,$i)/expo(100000,$i) +em;
}
}
//fuck the police
#mydiv {
width: 2.12197;
}
.cols-1 {
width: 1.12271em;
}
.cols-2 {
width: 1.1896em;
}
.cols-3 {
width: 1.26048em;
}
.cols-4 {
width: 1.33558em;
}
.cols-5 {
width: 1.41515em;
}
.cols-6 {
width: 1.49946em;
}
.cols-7 {
width: 1.5888em;
}
.cols-8 {
width: 1.68346em;
}
.cols-9 {
width: 1.78376em;
}
.cols-10 {
width: 1.89004em;
}
.cols-11 {
width: 2.00265em;
}
.cols-12 {
width: 2.12197em;
}
.cols-13 {
width: 2.24839em;
}
.cols-14 {
width: 2.38235em;
}
.cols-15 {
width: 2.52429em;
}
.cols-16 {
width: 2.67469em;
}
.cols-17 {
width: 2.83405em;
}
.cols-18 {
width: 3.0029em;
}
.cols-19 {
width: 3.18182em;
}
.cols-20 {
width: 3.37139em;
}
.cols-21 {
width: 3.57226em;
}
.cols-22 {
width: 3.78509em;
}
.cols-23 {
width: 4.01061em;
}
.cols-24 {
width: 4.24956em;
}
.cols-25 {
width: 4.50275em;
}
.cols-26 {
width: 4.77102em;
}
.cols-27 {
width: 5.05528em;
}
.cols-28 {
width: 5.35647em;
}
.cols-29 {
width: 5.67561em;
}
.cols-30 {
width: 6.01376em;
}
.cols-31 {
width: 6.37206em;
}
.cols-32 {
width: 6.75171em;
}
.cols-33 {
width: 7.15398em;
}
.cols-34 {
width: 7.58021em;
}
.cols-35 {
width: 8.03184em;
}
.cols-36 {
width: 8.51038em;
}
.cols-37 {
width: 9.01743em;
}
.cols-38 {
width: 9.55468em;
}
.cols-39 {
width: 10.12395em;
}
.cols-40 {
width: 10.72714em;
}
.cols-41 {
width: 11.36626em;
}
.cols-42 {
width: 12.04346em;
}
.cols-43 {
width: 12.76101em;
}
.cols-44 {
width: 13.52131em;
}
.cols-45 {
width: 14.32691em;
}
.cols-46 {
width: 15.18051em;
}
.cols-47 {
width: 16.08496em;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment