Gambling, like a lot of things, is better enjoyed with music.

In your weekly poker game with your buddies, some background jams can enhance the friendly atmosphere among the joking and trash talking. In the casinos, a pair of headphones will drown out the annoying sounds of slot machines and chatty tourists. And while gambling in an online casino, earbuds will allow you to get in your groove, block out distractions and keep your energy up during marathon playing sessions.

Many professional poker players listen to music while playing. Headphones have become just as common as sunglasses on the professional circuits. There are plenty of reasons to believe that music can improve your poker game.

One of these ways is through a psychological concept known as “classical conditioning.” In other words, music affects the way we feel by associating various memories and emotions with different songs. The way we feel then in turn affects the choices we make. When we’re frustrated or discouraged we tend to make irrational decisions. Likewise, we do our best thinking when we’re in a calm, happy state.

Professional poker player Joe Sebok was able to end a long losing streak by going back to some music he listened to while he was on a winning streak. He associated that music with winning, which restored his confidence in himself and thus boosted his play. This phenomenon is broken down further in this article.

For tournament poker players, variety is key. During sessions that can drag on for several hours at a time you will experience different states of emotion. You’ll have highs and lows, moments of high intensity followed by times of mellowness. A good poker playlist will reflect the range of mental and emotional levels found at the table. If you’re not playing well, put on something upbeat and happy that will prevent you from making poor choices with your cards or just something mellow to cool you down. Likewise, if you’re running hot you may want something rhythmical and pulsing to help you ride out the streak or something loud and high-energy to perk you up near the end of a long day of playing.

Pros John D’ Augustino and Robert Williamson choose different music based on when they feel they have to be aggressive or when they have to loosen the strings. Annie Duke likes to cue up the White Stripes’ “Seven Nation Army” when her chip stack is small and her back is against the wall. Antonio Esfandiari goes for Eminem’s “Lose Yourself” for confidence.

Music and gambling extends beyond just live gaming however. Many people now do their gambling in online casinos and will spend hours at a time hovering over their computer monitor playing slot machines, online poker or blackjack, roulette tables — basically anything that can be found in a brick and mortar casino. As with live casino gaming, the benefits of the right music is also true in the online gambling realm.

A study published in Psychology Today showed that the right kind of music can boost productivity on repetitive tasks (i.e. playing an online casino), enhance performance on cognitive tasks and can give you a motivational jumpstart on such tasks.

While trolling Betfair’s slots I found a variety of different soundtracks for different themed slot machine games such as Ghostbusters, Star Trek or Kitty Glitter. Each provided their own sound effects and music related to their respective theme. But if you want to replace that music with something of your own liking—and you’re playing on your computer where you probably have hundreds if not thousands of songs in your database to choose from—choose your music wisely.

A 2007 study investigated how music tempo affects betting at a roulette table and the results indicated the pace of betting was in direct correlation with the speed of the music. Faster tempo music led to more rapid betting while slower music equated to a slower pace of money being tossed around.

So when you’re sitting on the felt blackjack tables of a casino, playing poker in your buddy’s garage or having a marathon online slot machine session, choose the type of music that is not only right for the occasion but will optimize your play at the same time.