Some tutorial collection
ref: https://www.kiasuparents.com/kiasu/forum/viewtopic.php?f=12&t=47244
string $names[]={"C","D","E","F","G","A","B"}; string $names2[]={"C","d_b","D","e_b","E","F","g_b","G","a_b","A","b_b","B"}; // -- white keys only $total=7*5; for ($i=0;$i<$total;$i++){ int $n=$i%7; int $oct=$i/7; $tCube=`polyCube -ch on -o on -w 1 -h 1 -d 2 -cuv 4 -n ($names[$n]+"_1")`; float $s=$n; if($n>=3) $s=$s-0.5; move -a $i ($oct*6+$s) $oct $tCube[0]; } for($i=1;$i<=5;$i++){ select -r ("*_"+$i); group -n ("octGrp_"+$i); } // -- white keys and black keys $total=12*5; for ($i=0;$i<$total;$i++){ int $n=$i%12; int $oct=$i/12; $tCube=`polyCube -ch on -o on -w 1 -h 1 -d 2 -cuv 4 -n ("ns1:"+$names2[$n]+"_1")`; string $sn=$tCube[0]; move -a ($oct*6+$n*0.5+$oct) ($oct*6+$n*0.5) ($oct+10) $tCube[0]; if($n>=5) move -r 0.5 0 0 $tCube[0]; if(`gmatch $sn "*_b_*"`) move -r 0 0 -.5 $tCube[0]; }