Guided by the Mountcastle organizational principle for the column as the basic neuronal network in the cortex, we developed the trion model. An essential feature of the model is that it is highly structured in time and in spatial connections. Simulations of a network of trions have shown that large numbers of quasi-stable, periodic spatial-temporal firing patterns can be excited. These patterns can be readily enhanced by only a small change in connection strengths, and the patterns evolve in certain natural sequences from one to another. With only somewhat different parameters than those used for studying memory and pattern recognition, much more flowing and intriguing patterns emerged from the simulations. The results were striking when these probabilistic evolutions were mapped onto pitches and instrument timbres to produce music: For example, different simple mappings of the same evolution give music having the "flavor" of a minuet, a waltz, certain folk music, or styles of specific periods of Western art music. A theme can be learned so that evolutions have this theme and its variations recur. We suggest that we have found a viable cortical model for the coding of certain aspects of musical structure in human composition and perception. Further, we propose that the trion model is relevant for examining creativity in those higher cognitive functions of mathematics and chess that are similar to music.