The main goal of this thesis is the analysis, design and implementation of a new system, which would be able to generate music in real-time, based on terrain data or any raster image. The thesis deals with history of development of various attempts to formalize musical composition and presents contemporary approaches to its algorithmic creation. Technique of constraint programming is explored as well, because it is suitable also for automatic composition, and it is a part of implemented solution. Application components (interface, generator, music core and sound unit) and their interactions are examined in more detail. All approaches used for generating music are described in depth and, moreover, they are supported by many pictures and prac...