It might sound like a very simple question, and that's the beauty of it. This post isn't about saying police are bad guys. (Some are, some aren't, not really surprising. When it comes to interacting with police and security, especially when you are consuming alcohol or any other party favors.
For example, an officer might approach you casually and just ask you a few questions, “hey where are you from, how old are you, have you been drinking…” The questions can suddenly shift into a crime investigation, and you may not be sure as to whether you are allowed to just get up a leave.
This is when you ask the office the money question, Am I free to leave?
Police officers will other go to great lengths to convince you to give them permission to search your belongings. It's amazing how often people give the police permission to search, when it would have otherwise been an illegal search if they had objected, and there were illegal items in the bag.
When you ask an officer if you are free to leave or if you are being detained, you are basically stripping away the majority of the legal non-sense and distraction. If you are free to leave, then say thank you and goodbye politely and be on your way. If he's hell bent on arresting your or detaining you, he could hold you for some period of time to further investigate. Don't resist, remain calm, let them know you are retaining an attorney immediately and if you are arrested, you will have your legal team work on getting bail in place for you.
Just remember. There are things most of us would rather do than make chit-chat with cops at events that could possibly arrest you. So be cool, give people space and treat everyone with respect. If you are smart enough not to do anything illegal in the open at a concert or festival, it is very unlikely that you will provide the police with probable cause to search you. That is: As long as you don't consent to the search. Searches are bad, mmmkay?