~voice = [1, 0, 0, 1, 1];
~of = ~voice.size.collect{|i|
case(
{i == 0}, { 0.dup(2) },
{i == 1}, { 0.dup(5) },
{i == 2}, { 0.dup(3) }
) ++ ~voice
}
Adding things to the array is done with ++
which is concatenation.
~voice = [1, 0, 0, 1, 1];
~of = ~voice.size.collect{|i|
case(
{i == 0}, { 0.dup(2) },
{i == 1}, { 0.dup(5) },
{i == 2}, { 0.dup(3) }
) ++ ~voice
}
Adding things to the array is done with ++
which is concatenation.