Jazz is all about freedom and absorbing musical influences from around the world, and the Baku Jazz Festival showed very well how an eclectic selection of music could be extremely creative.
Musicians from different nationalities and cultural backgrounds worked together at the jam sessions, despite having never met before, and amazed their audiences as they improvised.
The event was opened by the Turkish blues and rock band of Feti Çağlayan, but other acts also shone through.
Among them was the Freedom Trio, a collective of three musicians from three continents who are now based in Sweden.
The Trio of Deodata Siquir from Mozambique, Rubem Farias from Bazil and Steinar Aadnekvam from Norway has performed over a hundred concerts at clubs and festivals across Europe and the US since they came together in 2015.
Their second album — titled "Freedoms Trio II” — was released last year.
Dutch saxophonist Yuri Honing performed an acoustic quartet with his compatriots Joost Lijbaart on drums and pianist Wolfert Brederode, as well as bass player Gulli Gudmundsson from Iceland.
He told Euronews about the many competing influences on his music.
"I went from classical music to jazz music, to Arab music for a long time and then pop music for a pretty long time, [then] rock music and now I am blending in everything in," he says.
"Of course there are many influences but there should be many influences, it's a nice thing to have many sources to rely on."
The 54 year old started playing the piano when he was five and then switched to saxophone aged 12.
He is now considered one of the world's most creative saxophonists. A new album is out next spring.
But it's not just about established artists and groups at the Baku Jazz Festival. There is also an international competition in various disciplines to promote young talents.
The jury president, Rauf Alyev, says it is not only about talent but also takes stamina and diligence to become a successful jazz musician.
"You have to understand who is a hard worker," he says, noting that some young musicians tend to coast on their talent without putting in the hard graft involved in establishing themselves as recognised artists."
One such group is the German MASAA — made up of Lebanese singer Rabih Lahoud, drummer-percussionist Demian Kappenstein, Marcus Rust on trumpet and guitarist Reentko Dirks.
They are based in based in Dresden and Lahoud writes the lyrics and sings in both Arabic and French, although he insists the words are not necessarily the most important part of his music.
"Well the Arab language plays a role in this band but not in a sense where it is centrally important — it's more about the sound of the words, that’s why I play around with words to create an ambience."
Then there is the French singer, pianist and composer Julie Erikssen, who brings together pop and French style of jazz and blues. Her album "Out of Chaos" was released last year.
"I was very attracted to the piano and to classical music when I was small, so I listen Romantic era music like Chopin and Liszt," she tells Euronews.
"I found my love of singing by looking through the jazz discs of my parents and I also sang in church, so I am interested in gospel, which is in my opinion the essence of song."