Supplemental answer:
The equation given in Mark Adler's answer is what was actually used in the calculation of shuttle dynamic pressure. Max Q would trivially be the maximum value reached. Don't over think it. What goes into the equation is the freestream velocity and a table lookup of density vs. altitude.
Here is a page from the DADS Training Manual with the proof.
DADS was the program used to design the ascent trajectory for shuttle. This was done on the day of launch (reference includes links). A major constraint on the trajectory design was to keep the dynamic pressure as close as possible to the structural limit without exceeding it.
This equation was used to calculate the dynamic pressure throughout the generation of the first stage trajectory including the supersonic regime.
Source: DADS Training Manual