473,394 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Re: Building musical chords starting from (a lot of) rules

I think I've found a nice way to represent and build chords. At least,
at the moment it satisfy me, maybe later I'll understand how it sucks.

I'm using two separate classes: one represent a chord and is
implemented as a set of Notes; the other represents the structure
(type) of the chord and is a set of Intervals.

I can build a chord in different ways, but the general idea is that I
need a root note and a structure.

The structure isn't bound to any particular chord, because it doesn't
contain notes, but just intervals. So I can have the structure of
minor chord, of a major chord and apply them to two different notes
and build my chords.

So what is important is just the parsing of the structure. The
structure will be a string: at the moment I'm considering it space
separated, so kind of: 'min 9 no5'

I split it in a list and start from the third. I check if there's a
no3, then if there's 'min' and I put a minor third. I do the same for
the fifth. Then the first element will be the main chord structure,
because it could be a 7, a 9, a 11, a 13 and so on. I have a
dictionary with this structures, in this way:

chord_structs = {'9': ['b7', '9'], '11': ....., '13': .....}

So if the element is in the dictionary, I add the intervals listed,
else I just add the element. That's the case of the 7, or 6 etc. Then
I'll add the rest of the structure.

This is not complete or perfect, neither explained so well, but that's
the main idea.

Thanks for the help :D
bye
Nov 19 '08 #1
0 1841

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Slavik | last post by:
All libraries were installed (precompiled) This is FreeBSD 5.1 installed zlib, installed jpeg and png libraries (in default directories) GD 2.0.11 source is in /usr/gd-2.0.11 (compiled and...
17
by: Mark Tranchant | last post by:
On some of my pages, for example: http://tranchant.plus.com/guitar/chord-tutorial/music-theory ....I refer to musical note names a lot in the text, such as A, F# and Eb. Whilst cycling in to...
2
by: Mark Tranchant | last post by:
Thanks for the input everyone. I've settled (for now) on the following: <abbr title="B flat">Bb</abbr> My magic conversion to pander to IE's non-support of <abbr> has now been turned off as...
2
by: Matthew Crouch | last post by:
Okay, I've come up with hacky workarounds every time I build an app, and now I just need some tips on how to do this correctly and efficiently. I usually have a head.inc and/or a constants.inc...
6
by: Bas Cost Budde | last post by:
I play in a band (contrabass) and store the chords for our songs in an application. Its two main purposes are * to easily transpose a song * to display a set list (enlarged chord symbols) that...
3
by: thomson | last post by:
Hi All, While Iam building my solution, the VS 2003 editor get stucked, for a few minutes and after sometimes it gets recovered, and the solution building done, While building i looked into the...
2
by: Andreas Prilop | last post by:
Is Ruby annotation http://www.w3.org/TR/ruby/ suitable for text with musical score written with symbols from http://www.unicode.org/charts/PDF/U1D100.pdf ? -- All free men, wherever they may...
3
by: clintonG | last post by:
This article has shown me how to playing system sounds and .wav files via a web page. Very nice to know. It got me wondering if we could somehow play one or more tones of a musical scale somehow...
7
by: Mr.SpOOn | last post by:
Hi, I'm writing a method to create musical chords. This method must follow a specific set of syntax rules. At least, this is my idea, but maybe there's a better way. Anyway, in the code I have...
0
by: Dan Upton | last post by:
On Fri, Nov 14, 2008 at 1:00 PM, Mr. SpOOn <mr.spoon21@gmail.comwrote: I don't know if this is any better, but you could represent a chord formula as a 15-tuple consisting of (-, n, b, #) for...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.