You can represent music as graphs and do computation on it. Probably the coolest consequence of that is you can teach music theory and theory of computation at the same time using the same structures.

Sonata form: Start with an exposition section. It's composed of two sections. Section A in the main key, and Section B in the dominant key. After exposition is a development section. This section uses Section A and/or Section B from the exposition section, using a dominant, subdominant, or relative minor, combining and expanding on those. After development is recapitulation, where you have Section A then Section B in the main key.
(Sorry, musicians, if this is a bit off. It's good enough (tm) for this.)
Here's the same thing as a "regex":

Code:
(AY)+(A*|B*|X*|Y*|a*|b*|x*|y*)+(AB)+

A - Main key A section
B - Main key B section
a - Minor key A section
b - Minor key B section
X - Dominant key A section
Y - Dominant key B section
x - Subdominant key A section
y - Subdominant key B section

Want more of the optional features? Bigger regex:

Code:
(?<Intro>i)?(?<Exposition>At?Yc?o?)+(?<Development>A*|B*|X*|Y*|a*|b*|x*|y*)+(?<Retransition>r)?(?<Recapitulation>At?Bc?o?)+(?<Coda>d)?



A - Main key A section
B - Main key B section
a - Minor key A section
b - Minor key B section
X - Dominant key A section
Y - Dominant key B section
x - Subdominant key A section
y - Subdominant key B section
i - Intro
t - Transition
c - Closing theme
o - Codetta
r - Retransition
d - Coda

The circle of fifths is a graph and chord progressions are finite state machines.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement