Analysing Chords

Muzza's icon

Hi guys. I've got a patch set up in a way that it stores the midi note numbers being played in seperate int boxes (eg. playing a c Major triad stores 48 52 55 independantly). How do i get Max to analyse these numbers to find the root of the chord, baring in mind the chords could be in any position (not always root) and any type (major, minor, dim 7th) ?

Gary Lee Nelson's icon

Sounds like a job for Peter Elsea's fuzzy logic stuff. He has a tutorial
that talks about exactly this kind of thing.

On 3/19/07 8:04 PM, "Bill Murray" wrote:

>
> Hi guys. I've got a patch set up in a way that it stores the midi note numbers
> being played in seperate int boxes (eg. playing a c Major triad stores 48 52
> 55 independantly). How do i get Max to analyse these numbers to find the root
> of the chord, baring in mind the chords could be in any position (not always
> root) and any type (major, minor, dim 7th) ?

Cheers
Gary Lee Nelson
Oberlin College
www.timara.oberlin.edu/GaryLeeNelson

Peter McCulloch's icon

For a further look at this, you should check out Robert Rowe's books.

Peter McCulloch

On Mar 19, 2007, at 8:04 PM, Bill Murray wrote:

>
> Hi guys. I've got a patch set up in a way that it stores the midi note
> numbers being played in seperate int boxes (eg. playing a c Major
> triad stores 48 52 55 independantly). How do i get Max to analyse
> these numbers to find the root of the chord, baring in mind the chords
> could be in any position (not always root) and any type (major, minor,
> dim 7th) ?
>
>
www.petermcculloch.com

Roman Thilenius's icon

by comparing your three numbers versus a predefined set
of chords (which are also lists of three numbers) using +,-,
pak, unpack, ==, zl, ...

-110

Steven Miller's icon

Check out the books 'Machine Musicianship' by Robert Rowe and
'Composing Interactive Music' by Todd Winkler, both published by MIT
Press - both have good explanations of various algorithms to
accomplish these types of tasks, and working example Max patches on
the accompanying CD-ROMs.

On Mar 19, 2007, at 6:04 PM, Bill Murray wrote:

>
> Hi guys. I've got a patch set up in a way that it stores the midi
> note numbers being played in seperate int boxes (eg. playing a c
> Major triad stores 48 52 55 independantly). How do i get Max to
> analyse these numbers to find the root of the chord, baring in mind
> the chords could be in any position (not always root) and any type
> (major, minor, dim 7th) ?

----
Steven M. Miller

Home
SFIFEM
Atrium Sound Space
OVOS

seejayjames's icon

Think about using twelve-tone theory, in that you want to distill any combination / position etc. to its prime form... so a major chord is 0 4 7, a minor one is 0 3 7, etc..... Would take some doing but you could then compare any combination to a predetermined list of chords of any level of complexity.

--CJ

Gary Lee Nelson's icon

Elsea's tutorial, and I am a bit fuzzy on this, shows chords represented as
a binary vector where each of twelve values represents the presence or
absence of a pitch class. For example, C major (0 4 7) would be

1 0 0 0 1 0 0 1 0 0 0 0

F major is

1 0 0 0 0 1 0 0 0 1 0 0

If you rotate F major 5 positions left it matches C major. This method can
be used to identify chord types. Rotate until you get a match. The number
of rotations (mod 12) is the root.

On 3/19/07 11:41 PM, "Seejay James" wrote:

>
> Think about using twelve-tone theory, in that you want to distill any
> combination / position etc. to its prime form... so a major chord is 0 4 7, a
> minor one is 0 3 7, etc..... Would take some doing but you could then compare
> any combination to a predetermined list of chords of any level of complexity.
>
> --CJ
>

Cheers
Gary Lee Nelson
Oberlin College
www.timara.oberlin.edu/GaryLeeNelson

Olaf Matthes's icon

Steven Miller wrote:
> Check out the books 'Machine Musicianship' by Robert Rowe and 'Composing
> Interactive Music' by Todd Winkler, both published by MIT Press - both
> have good explanations of various algorithms to accomplish these types
> of tasks, and working example Max patches on the accompanying CD-ROMs.

Highly recommended from my side as well!

Or check this one: http://artificial-tango.nullmedium.de/ - it includes
a [at.chord] external that detects almost any chord there is. And there
is [at.tonic] which tells you the tonic you're playing in.
Drawback is that it requires FTM 2.0 and Iracm still hasen't realease
the final version of it... (and there is no Windows version right now).
At least on OS X you could try to compile FTM 2.0 yourselfe if you have
a day to spare.

Olaf