Welcome to %s forums

BrainModular Users Forum

Login Register

Having troubles with custom touch-keyboard patch

I need help on a Patch
Post Reply
User avatar
x.iso
Member
Posts: 565
Location: RU, Saint-Petersburg
Contact:

Unread post by x.iso » 12 Feb 2018, 03:08

I'm trying to build a touch-keyboard, that would act in similar way to iOS/Windows10 app Figure.
So far so good I'm getting some results, but lots of problems to solve.
Image

Figure-like Keyboard patch here

This patch is based on keyboard14notes patch from Add-ons, but I made a ton of changes.

I'll add info about specific problems I'm having, but here's few from the top of the head:

1) with arpeggio off notes are played only in sequence, when trying chords with multi-touch. Is it even possible to get simultaneous parallel midi messages from polyphonic patch?

2) arpeggio for some reason always plays one note twice, then the next etc, not sure why and how to change that. is there good alternatives to one in this patch?

3) can't figure out a way to make 'hold' effect for arpeggio, I guess I need to make notes 'stuck' whenever number of active pressed notes gets decreased (any finger goes up), and then release them with proper note off messages on next press of any note and further as long as number of notes increases. maybe there's better approach or idea for this?

4) if it's possible to make hold effect mentioned earlier, it would be best to make it so that shapes in containers don't disappear from where they were left, to have visual feedback on what notes are playing. maybe even make them appear or blink in sequence that arpeggio plays.

5) is it possible to make a switch for different modes, current with isolated vertical lock of notes and another: free slide across notes, trigger notes as they get under finger and release as they leave. I suspect that I would need a big invisible container on top of notes to track x/y coordinates and perhaps draw circle along the path, and use mouse over output for tracking active notes.
join Hollyhock Usine Discord server: https://discord.gg/EdJarnE

User avatar
x.iso
Member
Posts: 565
Location: RU, Saint-Petersburg
Contact:

Unread post by x.iso » 12 Feb 2018, 03:11

oh, btw, also can't figure out how to consistently get what the note is mapped from code (A-F), I need to mark root note with one color ,C with another, and perhaps half-tones with third shade, then generate captions for each note.
join Hollyhock Usine Discord server: https://discord.gg/EdJarnE

User avatar
x.iso
Member
Posts: 565
Location: RU, Saint-Petersburg
Contact:

Unread post by x.iso » 12 Feb 2018, 03:14

another problem I remembered - somehow Matrix doesn't want to recall presets of the patch properly, it shows cells properly, but values don't update. I've been setting up a quick preset switch there, but disabled for now, as it's broken.
join Hollyhock Usine Discord server: https://discord.gg/EdJarnE

User avatar
x.iso
Member
Posts: 565
Location: RU, Saint-Petersburg
Contact:

Unread post by x.iso » 14 Feb 2018, 02:40

updated the patch with some fixes that were due to my mistakes.

problem #1 filed as bug report as it seems to play just fine only if midi out or filter module settings is pinned.

problem #2 seems to be fixed by me

got some ideas to try for questions #5, but #3, #4, 6# and #7 still stands.

additionally, due to some weird behaviour or bug the keys might shift down 880 pixels upon loading patch, it can be moved back only after changing target where it appears back and forth. filed this as bug report.
join Hollyhock Usine Discord server: https://discord.gg/EdJarnE

User avatar
x.iso
Member
Posts: 565
Location: RU, Saint-Petersburg
Contact:

Unread post by x.iso » 27 Feb 2018, 01:36

So, problems #1 and #7 fixed with updates, problem #6 figured out.
Visual side not finished, but close to what I want.
http://www.sensomusic.org/forums/upload ... uchkey.gif

For now I can't come up with a good way to make 'slide' mode where notes would be triggered only when touchpoint is in the area of the note and released when it leaves the area and goes to the next.

Also 'Hold' mode is partly done, but it requires to manually retrigger notes held to release them back. At first I though of just making all notes stuck as long as HOLD is on, and then release all notes when it's turned off, but maybe there's better solution?

Other things in plans: more max notes (21 currently), two rows, possibly with different assignable output channels. invisible -1-1 fader injection to the notes which will reset to 0 when note is released, for additional modulation output as the note is dragged up and down even beyond note area.

Also, technically if I add pitch modulation to X axis, could be possible to make MPE-like vibratos and individual note glides.
Anyone up to augment my ideas?
join Hollyhock Usine Discord server: https://discord.gg/EdJarnE

User avatar
x.iso
Member
Posts: 565
Location: RU, Saint-Petersburg
Contact:

Unread post by x.iso » 06 Mar 2018, 00:16

So I'm getting closer to what I initially wanted from this little 'project' of mine, here's the patch:
http://www.sensomusic.org/forums/upload ... _Fig51.pat

Progress: I've added second row option with setting to differentiate each row channel. Updated visuals, now I really like how the sequence-wheel looks and works, with ability to preview the pattern presets before lifting finger and applying (but it still messes with current loop if navigated preset has different steps number, so far no idea how to circumvent that). Added sync button for arpeggio interval, so each note is same length as one step. Notes now light up when touched and additionally light up (intensity adds) when either arpeggio triggers the notes or external midi source is hitting notes that are represented in keyboard. External midi can now be processed with arpeggiator in this patch. Some other minor tweaks and fixes.

Problems: Hold button that I've implemented only worked with arpeggiator disabled and without visual cue to what note is held, so I've temporary hid it. Still no idea how to implement slide mode, so you could slide and shift fingers across the notes, triggering them according to fingers position. While those two modes are essential for me to feel like this keyboard is more or less complete, the main problem arise - this patch now consumes about 40% on my PC, and apparently there are some errors in key dispatching script (which I took from original keyboard_14Notes patch from add-ons). I'll try to hunt down the culprit for CPU consumption as it's not anywhere near acceptable, even though still usable. So far I'm seeing that most CPU usage is in each keyboard row polyphonic sub-patch. It's either the problem with the scripts (which is out of my expertise) or did I made it too 'fancy' and complicated? Wheel sub-patch consumes about 8,5% at top, which is fine by me if it's because of graphics.

I'll add screenshot later and then record a video to demonstrate what I've build it for, but you can guess pretty easily if you have touchscreen.
join Hollyhock Usine Discord server: https://discord.gg/EdJarnE

User avatar
nay-seven
Site Admin
Posts: 5684
Location: rennes France
Contact:

Unread post by nay-seven » 06 Mar 2018, 14:55

Impressive work !

User avatar
x.iso
Member
Posts: 565
Location: RU, Saint-Petersburg
Contact:

Unread post by x.iso » 06 Mar 2018, 19:32

Thanks! Any comments on how to optimize the patch?
join Hollyhock Usine Discord server: https://discord.gg/EdJarnE

User avatar
nay-seven
Site Admin
Posts: 5684
Location: rennes France
Contact:

Unread post by nay-seven » 06 Mar 2018, 21:28

not sure to have time to explore all this complex work, but yes, it use a lot of cpu, i'm afraid the splendid graphic part cost a lot
i've also this error at start:

Image

on my side, my first tentation was to hack your preset manager ring as a fun sequencer ;-)

User avatar
x.iso
Member
Posts: 565
Location: RU, Saint-Petersburg
Contact:

Unread post by x.iso » 06 Mar 2018, 23:41

nay-seven wrote:not sure to have time to explore all this complex work, but yes, it use a lot of cpu, i'm afraid the splendid graphic part cost a lot
i've also this error at start:

http://www.sensomusic.org/forums/upload ... =error.png

on my side, my first tentation was to hack your preset manager ring as a fun sequencer ;-)
well, the sequencer part takes about 8% max, which would be fine since it's the most (graphically) complicated part of the patch, but the key rows polyphonic patch is the culprit as it takes anywhere from 12 to 16% for no apparent reason (and I wouldn't call it graphically demanding). It's not because of the scripts, since without them it still stays at 12%. I've tried removing many things, but only removing key polyphonic patch solves the usage. inside the sub-patch I've tried to cut various things, but didn't get any impact so far. maybe some bug?

speaking of scripts, it seems that it doesn't like that array starts from output 0, but everything works regardless. shifting it to start from 1 messes up the note sequence at the outputs.

It's good that I can at least use this patch as a creation tool to make melodies the easier (and lazier) way without honing the regular keyboard skills too much. But I wouldn't upload it as add-on in this state yet.
join Hollyhock Usine Discord server: https://discord.gg/EdJarnE

User avatar
x.iso
Member
Posts: 565
Location: RU, Saint-Petersburg
Contact:

Unread post by x.iso » 07 Mar 2018, 12:50

here's the quick (in terms of how it was prepared) video demonstration of this patch:
https://vk.com/video2367116_456239035
hopefully the link will work
join Hollyhock Usine Discord server: https://discord.gg/EdJarnE

User avatar
nay-seven
Site Admin
Posts: 5684
Location: rennes France
Contact:

Unread post by nay-seven » 08 Mar 2018, 09:17

Great work !
I added it to our Facebook page

User avatar
x.iso
Member
Posts: 565
Location: RU, Saint-Petersburg
Contact:

Unread post by x.iso » 09 Mar 2018, 14:22

Oh, thanks! But I've originally planned to do a better version, which I just did:
https://youtu.be/7244ER2V-T8
also with some updates like added swing and arpeggiator sequencer retrigger on/off switch.
join Hollyhock Usine Discord server: https://discord.gg/EdJarnE

User avatar
x.iso
Member
Posts: 565
Location: RU, Saint-Petersburg
Contact:

Unread post by x.iso » 05 May 2019, 21:21

A bit of update while HH4 is in beta. I'm stuck with some problems that could potential be solved by coding and making user module, but since I'm a total noob at that I have a question if HH4 going to have any features that would allow me to do what I need using standard modules.

What I wanted is to be able to track touch points across the virtual keyboard (which layout is adaptive to Scale and Key), to have an option for Pitch-Slide (MPE featue) or at least to switch the notes on the fly as fingers slide across keys, that can be useful in conjunction with arpeggiator (want to simulate Figure app behaviour on that regard).

Right now each key is basically it's own sub-patch with dynamically designated note and separate tracking for velocity (up-down).
join Hollyhock Usine Discord server: https://discord.gg/EdJarnE

User avatar
x.iso
Member
Posts: 565
Location: RU, Saint-Petersburg
Contact:

Unread post by x.iso » 05 May 2019, 23:38

Ok, I might have figured out that one finally. Just by chance I've noticed that when you use XY pad or Draw pad, if number of elements is less than touch input points, then mouse x/y becomes array! This is what I needed, so I set number of objects to 0 in XY pad and get raw X,Y points array from the module with only number of points that are actually active. Otherwise I get array of fixed size and can't cut off unused coordinates for proper triggering. Now I need to figure out how to incorporate different scales and way more efficient Virtual Keyboard will be done, at least core part of it.
join Hollyhock Usine Discord server: https://discord.gg/EdJarnE

User avatar
x.iso
Member
Posts: 565
Location: RU, Saint-Petersburg
Contact:

Unread post by x.iso » 06 May 2019, 02:50

Ugh, still not good enough. When multiple points of touch used, and then any of the points released, the array stays at maximum size till all points released, thus any tracked points get 'stuck' without reporting null. This makes some problems as there's no way to reliably discern the stuck notes to turn them off.
join Hollyhock Usine Discord server: https://discord.gg/EdJarnE

User avatar
rlgsbt
Member
Posts: 187
Location: Marseille
Contact:

Unread post by rlgsbt » 06 May 2019, 07:38

may be if object touch is off, then turn the note off and the xy to 0 ?

User avatar
x.iso
Member
Posts: 565
Location: RU, Saint-Petersburg
Contact:

Unread post by x.iso » 06 May 2019, 12:21

that's the main problem, 'objects touch' doesn't report off state properly when using touch. with mouse x,y method I can at least get null state when all touch points are gone, but can't shake off tracking of the points that are lifted along the way.
join Hollyhock Usine Discord server: https://discord.gg/EdJarnE

Post Reply

Who is online

Users browsing this forum: victorp and 58 guests