Looking for feedback on patch
Hi - I just finished my first Max patch. I did a chord generator as an exercise. It's based on a javascript scripter plugin I wrote for Logic here: https://github.com/EricGeorge/logic_scripter/blob/main/chords.js , which itself is inspired by the Reason Studio Chords and Scales player.
Everything seems to be working fine - but I suspect there are ways to make things more efficient, or use more relevant Max objects, especially for my data management.
I have some notes at the top describing key parts, but feel free to ask for any clarification on anything.
Thanks in advance for any feedback as I really look forward to improving my Max patch building.
for a first max patch .... great work indeed !
there are few bits and pieces that could be done more efficient, but that is not so important.
In first place you need to take care to avoid hanging notes,
which could happen while some notes are ON while either scale, tonality,
or any other parameter changes.
I would insert flush just before noteout, and bang it on any parameter change.
----
Even if you eventually want to add more than just major & minor scales,
you could preload the coll with indexes, without a need to create them every time.
1 coll line can hold much more than 128 items ...
Scale and tonality can form coll index
like this

I used this to fill the indexes buffer:

------------
I must add that I did not have a look at chord creation and so can't say much
about it's efficiency and if it is all correct.
Thanks for the suggestions. I like the idea of preloading the coll and not having to run through the scale generation each time. I'll also add in the flush as that is a great idea.
In general, is using multiple colls like I am to manage look ups the right approach or should I have approached managing all of this data in a different way?
[coll] is for sure the most effective object among all of this type, as long as we dont compare it to "array" in some other languages.
the only one which is faster is [zl reg], but it can only understand indexes of 1-n and is only comfortable to use with data consisting of single numbers or symbols.
note that there is no garantee that preloading textfiles into coll by setting an argument will work in any situation.
this is my attempt to mod a bit your patch, with some added stuff,
like only 1 note at a time, (maybe unneeed) duplicate notes filter,
and a bit reduced number of items to reach same result...
Not that I find it better, but it could give you another view of routing
stuff in max.
This is golden! Thanks for the demonstration and changes - I'm going to sift thru this and figure out your changes. I may have some questions later, but I do appreciate you doing this @source audio.
Source Audio - I really appreciate the pointers in your patch. I've incorporated a lot of them - I especially liked the logic for the color note as well as the various times to flush. And I removed all of my sends/receives as I can now route much better. Thanks again for helping out - this made a big difference for my work.
Regarding @SOURCE AUDIO beautiful patch - how is possible to hold the chord as long note is held?