Dynamic array generation and pattern formation for optical tweezers