Currently, when using the Chord Editor with "Relative" base mode, you can only choose chords with notes above the root. I would like to have the option to include notes up to one octave below the root.

Thank you,
Derren

Tags

No tags attached.

Has the bug occurred in previous versions?

Tested code revision (in case you know it)

Activities

Definitely an interesting idea but sadly not entirely trivial to implement with the current chord-related code. In particular the visual chord editor will get tricky to use - so far it constructs chords simply from the bottom note to the top note. But what if you click on a note below the current root note - will it become the new root note, or will it become an additional note below the root?

I'd think in that case it should be an additional note below the root - I think it makes sense to have the root note permanently set to C in "Relative" mode, like it is now. I would just prefer that it be the C one octave higher, to allow inversions. That would be consistent with how it works in Absolute mode, I think, since the only way to change the root then is to change the base key.
Are you saying that this would conflict with building chords from the bottom up?
Is all of the relevant chord-related code in PatternEditorDialogs?

Make the keyboard three octaves long. In CChordEditor::OnInitDialog(), change m_Keyboard.Init(m_hWnd, 2) to m_Keyboard.Init(m_hWnd, 3). Change the for loop to run from inotes=-13 to <24; change the inotes < 0 condition to inotes <= -13.

Indicate visually which note is the root note - maybe write "X" inside the root note's reddot, or 1, 2, and 3 in the other notes' reddot, or draw the root note with a different coloured dot. I have no idea how much work it took to make the sample map editor do this. Hopefully this can be done by changing only CChordEditor.

To this end, change the length of the for loop in CChordEditor::UpdateKeyboard to 3 * 12. Change note = 0 to note = 12. Below that, change if(i == note) b = CKeyboardControl::KEYFLAG_REDDOT; to KEYFLAG_BRIGHTDOT, and rearrange the if... else if so that the base note is checked last (if a user clicks the C- key while the editor is in relative mode there should be a red dot, otherwise it should be the root note colour.)

Leave the chord keys unsigned, so that a 0 indicates a note one octave below the root in relative mode, and the C one octave below the current note in absolute mode. Change the default chords starting on line 386 of TrackerSettings::TrackerSettings(conf) to be 12 higher (5, 8, 11 become 17, 20, 23.)

In CViewPattern::ConstructChord(), subtract 12 in the definition of chordNote. Check for underflows inside the for loop - if a special note were intended, like when TempStopNote calls this function, it would get caught before the loop. If there is an underflow, do not include the note.

Change the length of the for loop in CChordEditor::OnKeyboardNotify to 3 * 12.

Note that I haven't been able to make or test any of these changes yet. Do I need to pay for Visual Studio in order to compile OpenMPT?

Visual Studio 2017 or 2019 Community edition will do, but you need to make sure that you install MFC (it's not checked by default in the installer).

Some parts of your approach are a bit flawed, in the sense that they will break already saved chords (the whole adding / subtracting 12 thing), this is why I wanted to actually have negative offsets for chords in the MPTChord struct. If you are interested, I can send you what I have done so far, which is basically everything except for the chord editor. Then you could take on from there.