Example of Inversion of User input: User Input: ABCDG , Results Found: GDCBA, ABCGD
Hi,
I'm not a programmer, but I'm in the process of developing a website that I hope can be programmed from my MS Excel (with
VB Macros) worksheets. 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 that contain those notes.
I have the Main Page with the Search box done, and the table that it will search, also near complete. I have no problem directing a macro to return results as follows:
User Search: A B C D
Results 1: Chord-xxx A B C D
Results 2: Chord-xx A B C D E
Results 3: Scale-x A B C D E F#
But it will not find D C B A (because the chord is inverted from the search). This is the critical issue. Sure, I could put into 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 invert the chords by some logical process. Then I place these inversions in the table on the same row of the chord that I want to be returned:
Chord-xxx DCBA - CDBA, CBDA, CBAD, ABCD, ACBD, and on and on and on (all possible inversions)............
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 think I would need 7x7x7x7x7x7x7=5,764,801 inversions. Or is my math way off?
QUESTIONS:
1. Is there a logic pattern that I could use to create macros to create all possible inversions, or is there a better way? If there is a better way, please be specific if you could.
2. What programming tools would be best suited to get this thing working on the web, and how would it work, basically (or exactly), 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.
Any advice is welcome. Thanks in advance.
Jim