Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 09-23-2003, 03:54 PM   #1 (permalink)
JBurke
Registered User
 
Join Date: Sep 2003
Posts: 5
JBurke is on a distinguished road
Search -That Can Match Out Of Order Items

Hi,
I'm not a programmer, but I'm in the process of developing a concept for a website that I hope will eventually be programmed. The website will be for musician's that wish to search for chords and scales. The user inputs a series of notes, and matching chords and/or scales are found.
My problem is this: I will need a search engine that will search through a database and match things that are out of order.
The user can search for any of the 12 notes of music, in any order, no duplicates, maximum string of 7 notes per search.
The notes of music: A, A#, B, C, C#, D, D#, E, F, F#, G, G# .

Example:
say the user inputs A, B, C, D, E, F#, G into the search box.
I want the program to find (in the database) the "C Major-Mode 4 Scale" which contains these notes in the following order:
C, D, E, F#, G, A, B. (the same notes, just in a diferent order).

Is this possible without creating a database of every possible combination? I figure I would have to create millions of inversions, otherwise. If I were to have to create all these inversions to put into the database, how would I go about doing that?

Any info and/or advice would be greatly appreciated. Thanks in advance.

Jim
JBurke is offline   Reply With Quote
Old 09-23-2003, 04:00 PM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,470
sde is on a distinguished road
yes, definately possible.

you would need it to be a databse with a few tables.

table 1: notes
table 2: chords
table 3: relation

i will elaborate later .. i need to commute home now =)
__________________
Mike
sde is offline   Reply With Quote
Old 09-23-2003, 05:17 PM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,470
sde is on a distinguished road
the schema of the tables would be something like this:

Code:
Notes:
  noteID
  noteName

Chords:
  chordID
  chordName

Relation:
  chordID
  noteID
the logic from here is where it could go many different ways. here is how i'd approach it at first thought...

1. get the array of notes from the user.
2. for each chord, compare how many of the input array notes match.

3. after you match the input with a chord, it is still possible that the chord has more notes than what the user input. here i would count the total number of notes entered for the chord found.

4. compare the number of notes in the chord, to the number of notes in the user array.

5. if they match, then return the chord.

you could probably get pretty tricky if you didn't find an exact match around step number 4, and then list a suggestion of what the closest chord it found was if there is not an exact match.
__________________
Mike
sde is offline   Reply With Quote
Old 09-23-2003, 08:06 PM   #4 (permalink)
JBurke
Registered User
 
Join Date: Sep 2003
Posts: 5
JBurke is on a distinguished road
Thanks sde.
I have the chord and scale table complete, and I have the main screen with the search box and macro buttons all layed out in MS Excel.
I have no problem directing a macro to return as follows:

User Search: A B C D E F#
Results 1: Chord-x A B C D E F#
Results 2: Chord-xx A B C D E
Results 3: Chord-xxx A B C D

But it will not find F# E D C B A (because the chord is inverted from the search). This is the critical issue. Sure, I could put in my table every possible inversion, but with scales that may contain 7 notes, the possible inversions are in the millions. Ok, maybe I could create a macro that could create strings in my table, like:
Chord-x F# E D C B A, E F# D C B A, E D F# C B A, E D C F# B A and on and on and on............
The macro could then find an exact match in the row (in the on and on and on...... part), then be directed to go to the first column of that long, long, long row and return the information contained there. Bingo.
But to do that for searchable strings of 7 notes with all possible inversions I would need 7x7x7x7x7x7x7=5,764,801 inversions. Is there a logic pattern that I could use to create macros to create these strings, or is there a better way? Or , is my logic of that many possible inversions way off in the first place? What programming tools would be best suited to get this thing working on the web, and how would it work, basically, with inverted chords?

Basically, I use MS Excel and Photoshop. I want to be able to get as much done myself before calling (paying) for the services of a programmer.

Thanks in advance.

Jim
JBurke is offline   Reply With Quote
Old 09-23-2003, 09:16 PM   #5 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,470
sde is on a distinguished road
what is the end goal here?

are you a music teacher and you want a student to be able to open up this file and figure out chords?

is it something people will be going online to access?
__________________
Mike
sde is offline   Reply With Quote
Old 09-23-2003, 09:18 PM   #6 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,470
sde is on a distinguished road
also, what is your graphical representation of these notes? a staff? keyboard? guitar fret? or is it just the note names?
__________________
Mike
sde is offline   Reply With Quote
Old 09-24-2003, 04:00 AM   #7 (permalink)
JBurke
Registered User
 
Join Date: Sep 2003
Posts: 5
JBurke is on a distinguished road
The purpose is to create a website that musician's can search a string of notes (or a chord or scale name or structure) and find matching chords or scales. I want the user to be able to see the results as text, as well as fingering positions on a guitar or piano, and to be able to play them as MIDI.

There are websites that can show fingering positions, and play the sounds, but none that can search. So, first things first, is it possible for a user to search ABCEG, and get a result GECBA? And how could it be done?

I am an artist/musician that works out of my home. My idea is to create a free website with ad space. I hope to then be able to find a programmer to create a shareware version of this that could be marketed on the website. The shareware version would be much more powerful than the online version, and would be a unique MIDI sequencer. I have many ideas, a manual written of how I want it to work, a screenshot in Photoshop made, and an MS Excel worksheet in the works. I've also done research on competing websites and programs, and I want to make one that will blow them away.

So basically, I hope to get this working in MS Excel, and then convert to HTML, or find a programmer that would partner with me in getting this up and running. First things first, one problem/solution at a time.

Thanks
JBurke is offline   Reply With Quote
Old 09-24-2003, 08:41 AM   #8 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,470
sde is on a distinguished road
Quote:
is it possible for a user to search ABCEG, and get a result GECBA? And how could it be done?
yes, but i'm not sure within excel itself. for deployment over the internet, my tools of choice would be php as the scripting language, and mysql as the database.

the 'how it can be done' part is somewhat explained in the logic of my second post in this thread.
__________________
Mike
sde is offline   Reply With Quote
Old 09-24-2003, 11:53 AM   #9 (permalink)
dubsonic
Registered User
 
Join Date: May 2002
Posts: 10
dubsonic is on a distinguished road
Send a message via AIM to dubsonic
As a musician myself, I'm a bit confused. The example you gave above (using A, B, C, D, E, F#, G) would indeed be C Lydian (4th mode), but would also be A Dorian (2nd mode), B Phrygian (3rd mode), etc. Wouldn't you want to identify the mode that is native to that key signature? One sharp (F#) is G major/E minor, right? I guess you could list all of the possible modal combinations for each group of 7 notes. Seems like what you really want is a scale/chord calculator. Here's a couple I made for lessons4guitar.com:

Click Here

dub
dubsonic is offline   Reply With Quote
Old 09-24-2003, 07:49 PM   #10 (permalink)
JBurke
Registered User
 
Join Date: Sep 2003
Posts: 5
JBurke is on a distinguished road
Dubsonic, you make a good point (and a good and useful website, too). I would like to display multiple results to point out the different scale modes, and various chords that contain the same notes. Also, just because you do a search containing the notes of, say, the D Major7 chord, doesn't mean that the song your creating is in D Major.

However, I was just throwing out an example to make a point. My major point at this stage is to figure out the best way (or even if it's feasable) to create an engine or system that would find inversions of a chord or scale. And, yes, I guess a music calculator is a good description- but a calculator that plays music is the ultimate goal!

If you have any other suggestions, or tips, it would be appreciated. Thanks.
JBurke is offline   Reply With Quote
Old 09-25-2003, 09:50 AM   #11 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,470
sde is on a distinguished road
databasing chords and making it searchable is going to be a much easier project than making a MIDI player/recorder.

note that i use the term 'easier' because i'm comparing it to writting sequencing applications.

to integrate different modes as dubsonic mentions, you would probably need to make another table.

then the relation table would reference the mode id, chord id, and note id.

hmm .. it is more complicated than just that though.
__________________
Mike
sde is offline   Reply With Quote
Old 09-25-2003, 02:09 PM   #12 (permalink)
JBurke
Registered User
 
Join Date: Sep 2003
Posts: 5
JBurke is on a distinguished road
sde, about making a midi recorder/player, that would definetely be the task after a search procedure was nailed down.

About creating a Relation Table, I'm not sure that that would be necessary, because any returned results are obviously related since they contain the same notes. Songs are not created by a single chord. Therefore, a user may search a chord, then another chord, and another, (all seperate querys), and then determine what scales and modes are common to all the chords by just looking at them. If you query "A B C#", I would like the exact match to be the first results, and "A B C# Db" to be the second results, and so on. The user may then have a better idea what scales to try over any given sequence of chord accompaniment.

Does this make sense, or do you have something else in mind that I'm not grasping. I'm not a music theorist, though indeed, this project is making me much more musically aware. I'm really just trying to match things to say, oh yeah, ok, maybe that scale would sound good with those chords, or...what is this chord I'm playing on my guitar, and where else on the fret board can I play this chord, or....oh, this chord is D Minor7 b5, where are all the minor7 b5's on my guitar, piano, violin, lets see what those would sound like. I liken a search chord/scale search engine to a search on the computer help file. It sure beats looking through the index of the printed manual for the topic I'm interested in. And, suprisingly, I have yet to find one on the internet! To me, it's so programmable, and so useful, that I'm simply compelled to do it. Plus, it's fun.

Forgive me for rambling
JBurke is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
someone please help kickerman97 Java 3 10-19-2004 03:19 PM
Search keystoneman Standard C, C++ 8 10-06-2004 07:04 PM
Using ORDER BY in a select statement Epsilon PHP 3 08-22-2004 02:28 PM
Britain cracks down on paid search sde Code Newbie News 0 06-16-2004 06:53 AM
Please Review ZapMeta - New Search Engine khn Program Design and Methods 3 07-06-2003 09:15 AM


All times are GMT -8. The time now is 07:35 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting