We walked barefoot on the beach. Here, "barefoot" is an adverb telling only how we walked.
We walked on the beach in bare feet. Here, the prepositional phrase "in bare feet" is also adverbial in function, but modifies the entire clause, "we walked on the beach." The preposition "in" shows the relation between the "mode"
in which we appeared and the action we performed.
The "in" is not optional.
We decided to go to the dance in costume / in full evening dress / in our work clothes / in the nude.
You should not try to perform the tango while the orchestra is playing in waltz time. Of course you don't have to use a prepositional phrase. You could say, "while the orchestra is playing a waltz."
- A.