A virtual instrument for real-time music generation comprising: a Musical Rule Set, MRS, unit comprising a predefined composer input, said MRS unit is configured to select a set of instrument properties and at least one set of adaptable rule definition based on the predefined composer input and combine the selected set of adaptable rule definition with a real-time control signal into note trigger signals associated with time and frequency domain properties, wherein the note trigger signals are outputted to a Timing Constrained Pitch Generator, TCPG, the note trigger signals comprising a pitch select signal and an input trigger signal; the TCPG, configured to generate an output signal representing the music; said TCPG being configured to synchronize the new generated tones in time and frequency domains based on the note trigger signals, wherein the TCPG comprises a rhythm generator, a pitch generator and an event producer, wherein the rhythm generator is arranged to control the pitch generator through an internal trigger signal, wherein the pitch generator is configured to respond to the pitch select signal from the MRS unit in order to pick right tonal pitch and to transmit such note as a pitch signal whenever triggered by the internal trigger signal, wherein the event producer is configured to generate the output signal based on the incoming pitch signal, a gate signal and a dynamic signal; an audio generator configured to convert the output signal from the TCPG and combine it with the selected set of instrument properties into an audio signal; and wherein the at least one set of adaptable rule definitions describe real-time morphable music parameters and said morphable music parameters are controllable directly by the real-time control signal and the virtual instrument further comprises a musical transition handler configured to interpret the real-time control signal and handle transitions between different sections in the generated music based on musical characteristics according to the predefined composer input, such that the transitions are musically coherent with the adaptable rule definitions currently being morphed, wherein musically coherent means are perceived as musical to a human listener with knowledge of a current genre or style. a Musical Rule Set, MRS, unit comprising a predefined composer input, said MRS unit is configured to select a set of instrument properties and at least one set of adaptable rule definition based on the predefined composer input and combine the selected set of adaptable rule definition with a real-time control signal into note trigger signals associated with time and frequency domain properties, wherein the note trigger signals are outputted to a Timing Constrained Pitch Generator, TCPG, the note trigger signals comprising a pitch select signal and an input trigger signal; the TCPG, configured to generate an output signal representing the music; said TCPG being configured to synchronize the new generated tones in time and frequency domains based on the note trigger signals, wherein the TCPG comprises a rhythm generator, a pitch generator and an event producer, wherein the rhythm generator is arranged to control the pitch generator through an internal trigger signal, wherein the pitch generator is configured to respond to the pitch select signal from the MRS unit in order to pick right tonal pitch and to transmit such note as a pitch signal whenever triggered by the internal trigger signal, wherein the event producer is configured to generate the output signal based on the incoming pitch signal, a gate signal and a dynamic signal; an audio generator configured to convert the output signal from the TCPG and combine it with the selected set of instrument properties into an audio signal; and wherein the at least one set of adaptable rule definitions describe real-time morphable music parameters and said morphable music parameters are controllable directly by the real-time control signal and the virtual instrument further comprises a musical transition handler configured to interpret the real-time control signal and handle transitions between different sections in the generated music based on musical characteristics according to the predefined composer input, such that the transitions are musically coherent with the adaptable rule definitions currently being morphed, wherein musically coherent means are perceived as musical to a human listener with knowledge of a current genre or style.