How can I make a sound wave effect on a "wall" of cubes through animation nodes?
Without using animation nodes you can create a subdivided plane and make it the parent of a cube, then enable dupliverts on the plane to have an instance of the cube at each vertex. As you deform the plane the duplicates will move with each vertex.



To your question of using animation nodes - A Grid Mesh node will give you an array of vertices that you can use for the location of duplicates, while an Object Instancer node will make the duplicates, then use a subprogram to adjust each duplicate. You create a subprogram to be able to repeat a node setup for each item in a list.


Add a loop subprogram - A->Subprograms->Loop
On the Loop Input node add two iterators, one as an object list, the other a vector list.
Add an invoke node with A->Subprograms->My Loop (unless you renamed it), the Invoke Subprogram node will have input sockets for each iterator you have added.
Connect the output of the object instancer to the object list input of the Invoke node.
Connect the vertices from the Grid Mesh to the vector list input of the Invoke node.
Add an Object Transforms Output node.
Enable the location checkboxes to get an input socket for location.
Connect the Loop Input object to the object input of the Transforms Output node.
Connect the vector from the Loop Input to the location input of the Transforms Output node.


Now that you have the duplicates in place you connect in other nodes to alter the location. In this example I use separate and combine vector nodes and add in a number wiggle to alter the z location.



To get the distance between two objects there is a distance node -



Zach Hixson has recently started a tutorial series for animation nodes, you may want to have a look at his playlist