Just keep a database of the intervals belonging to chords, which can then be applied to any given keynote. Voicings can be traversed programmatically, and any combination outside of four frets can be...