When I heard the learn'd astronomer,
When the proofs, the figures, were ranged in columns before me,
When I was shown the charts and diagrams, to add, divide, and measure them,
When I sitting heard the astronomer where he lectured with much
applause in the lecture-room,
How soon unaccountable I became tired and sick,
Till rising and gliding out I wander'd off by myself,
In the mystical moist night-air, and from time to time,
The use of the word “When” at the beginning of the first four lines of the poem (an example of  anaphora ) indicates the buildup to the climactic moment here, where the room bursts into applause. Whitman is describing the exact moment when he faces this building tension and is surrounded by people who praise something that he cannot similarly appreciate. 

When I Heard the Learnd Astronomer