1. A device for automatically generating a real time accompaniment of input music data, said device comprising: a music input that receives music data, a music analyzer that analyzes received music data to obtain a music data description comprising one or more characteristics of the analyzed music data, a query generator that generates a query to a music database comprising music patterns and associated metadata comprising one or more characteristics of said music patterns, said query being generated from said music data description and from an accompaniment description describing preferences of said real time accompaniment and/or music rules describing general rules of music, a query interface that queries said music database using a generated query and that receives a music pattern selected from said music database by use of said query, and a music output that outputs said received music pattern.