Just intonation polyphonic synthesiser (help)

Alastair Baillie's icon

Hi guys, currently I am trying to create a playable keyboard instrument in just intonation. I followed this tutorial to produce the polyphony - https://cycling74.com/tutorials/polyphonic-synthesizer-video-tutorial - and have changed the mtof function in the poly with an expression that evaluates the interval of each voice relative to the current lowest note, and triggers a calculation to generate a just intonated frequency.

However, even before introducing this part - when the patch was exactly as described in the tutorial, I was still getting a whole bunch of clicks- does anyone know how to remove these? It seemed like the tutorial dealt with this, but it isn't working for me. Perhaps I've missed something.

The other 2 main issues I'm having is that notes can 'hang' on after they have been played, after which, the user cant turn them off. Also, changing the bass note, should retrigger the frequency calculation for each voice, which at the moment it does not seem to do. At the moment, playing chords on the keyboard will sometimes trigger the just intonated harmony correctly, and sometimes not. The fact that it works intermittently means I know I am close to solution, but for the life of me I cant figure it out.

Do any of you guys have any suggestions?
Thanks very much in advance
(By the way, in the object 'justintonationconverter' there arent currently enough conditions to evaluate intervals of more than an octave, and this needs to be completed, but this still allows for practical testing of the patch)

Synthesiser

Max Patch
Copy patch and select New From Clipboard in Max.

Poly object code

Max Patch
Copy patch and select New From Clipboard in Max.

Source Audio's icon

here is the deal - if you manage to make that justintonationconverter
patch without a single if object, and repost it here I'll post you much more efficient lowest
note held detector, which is essential to get bassnote defined fast.

Alastair Baillie's icon

Thanks Source Audio!
How does this look to you?

Max Patch
Copy patch and select New From Clipboard in Max.

Source Audio's icon

allready much better, just fix the mistake in the sel object
sel 1 13 -11 ... should be right
sel -11 13 11 ... a mistake, or ?

Source Audio's icon

here promised lowest note detector
yellow stuff is just to check the output, you can delete it together with
ksliders once it got integrated in your main patch.

I think you would like the fact that if object is involved here, ha ha

Max Patch
Copy patch and select New From Clipboard in Max.

coll outputs 0 if no notes are held, maybe you can use it for something ....
..........
Next step is to further optimise interval detection and justintonation expr objects.
That should get as fast as possible response for voice creation.

P.S. and check the just scale factors, you seem to have own interpretation...