@name FailCake Midi Parser Piano
@persist GTable:gtable [E O]:entity HoloIndex:array
@trigger all
interval(100)

if(first() | duped()){

GTable = gTable("stream",1)

E = entity()
O = owner()

for(I = 1,30){
holoCreate(I)
holoModel(I,"cube")
holoPos(I,E:toWorld(vec(0.5,I*3-1.5,1)))
holoScaleUnits(I,vec(20,3.2,3))
holoColor(I,vec(255,255,255))
holoMaterial(I,"phoenix_storms/fender_chrome")
holoParent(I,E)  
GTable["note_piano_"+I,number] = 0
}

}


for(I=1,30){
    
if(GTable["note_piano_"+I,number]){
holoPos(I,E:toWorld(vec(0.5,I*3-1.5,0)))
holoColor(I,vec(1,1,1))
timer("Re_"+I,100) # Needs Delay
}else{
holoColor(I,vec(255,255,255))
holoPos(I,E:toWorld(vec(0.5,I*3-1.5,1)))
}

if(clk("Re_"+I)){
GTable["note_piano_"+I,number] = 0 # Reset it.  
}

}

if(duped() & O:steamID() != "STEAM_0:1:20785590"){
selfDestructAll()    
}
