The flute is played five times in Act 1, the first time we hear it is at the beginning of the play in the stage directions, "A melody is heard, played upon a flute." It sets a mood at the beginning, making it a sign of sadness, melancholy, and sorrow. I believe that it is symbolic of Willy's futile pursuit of the American Dream.
The second time the flute is heard is when Willy "breaks off in amazement and fright as the flute is heard distantly." Here, the flute symbolizes panic and fright.
In addition, the flute is played when Willy was in the kitchen, he was somewhat in a trance, and was addressing Biff, who was not in reality there. Willy was "totally immersed in himself, smiling faintly." He was talking friendly with Biff, so happy and excited, so the flute symbolizes happiness, pleasure, and joy, which is when Willy remembers the good times with his son.
Once more, while Willy and Charley were having a chat, the flute is heard, who, playing the flute, is Ben. "Ben's music is heard." Ben is Willy's brother who died a couple of weeks ago. While we were in a flashback with Willy, the flute is heard again when Willy starts to remember Ben visiting his house in the past. Willy starts to remember the old times when they were together with their parents and how their father took the whole family in his wagon and drove them across the country flutes, stopping at towns to sell the flutes that their father made during the ride and get lots of money in return. So again, the flute here symbolizes times of joy and bliss in Willy's mind and memories.
In the end, from all the times the flute is played throughout the play, we can...