• Trill
  • craft accordion style controller

Hi Lokki, this sounds great. Looking forward to seeing the end result.

All the above options you mentioned would work nicely although I would definitely go towards an interface with some kind of tactile character, over a flat touch service. But that's me!

Since you get a continuous reading from all the capacitive channels on Trill Craft you can also interpolate between any different pads you choose. This means that you could create buttons which are actually made from three individual metal pieces mounted closely together. Maybe most of the time you touch all 3 pieces but it is also possible to sway your finger about so that the reading is stronger in one channel than another.

There are also some fun to be had with the mounting height of the metal pieces. Here's a project I made with 3 trill crafts and different sized brass strips: each gives a continuous reading.
alt text

Thanks for your answer. But splitting each button into multiple sections will double or triple the amount of trills I need I guess. Will try a simple version first and report back.

Maybe I can get away with reading the touched sensor and all the adjacent sensors act as directional sensors for modulation, will see..

4 days later

First prototype is working fine!
alt text

16 days later

Second version, one craft fully hooked up, some keys are doubled as on a real accordion. works quite well. probably the buttons are a bit too close together....

alt text

ok i thought about doing the same basic setup with a "capacitive" matrix, but i now realise that i don't exactly know if that would work, since i don't fully understand how capacitive sensing works i guess...

my idea was to recreate the above button setup (with 5 rows and columns at an "angle") by using 5 long strips of conductive tape for the rows and one shorter piece of conductive tape for each angled column.

so i could use 5 rows and 19 columns for example and use 24 pins on a craft. the row and column layer would be separated by a thin layer of insulating layer like plastic foil or similar. my thinking was that i could then read out each "button" position by a simple logic, so if the "button" at the 1column and 1row position would be touched i would get higher readings on first column and first row and could determine the touch has happened there.

until now i assumed this is basically how capacitive touchscreens work (with very thin wires you don't really see).
but thinking it through now i am not sure my idea would work. i guess what throws me off is the fact that the conductive tape is, well conductive and i don't see how i could differentiate more than one or two simultaneous touches that share some columns and rows. but maybe i am just confused.

it would be great if somebody could shed some light on this, and if my explanations are not clear i will try to rephrase them.

By reading the blog posts on the bela site for craft I am now under the impression, that more then 1 touch is not straight forward with my proposed setup (since the arrangement will be roughly similar to a trill square)

so how is multitouch done on a touchscreen?

    I had an idea for multitouch which I never tried to implement but might work.

    So the trill squares output values for X and Y. If there are multiple peaks on X and Y, you don't really know which X corresponds to which Y. However, if one X peak and one Y peak appeared and another appeared later, you can make an assumption about which peaks form a touch together.

    I made quick drawing in paint to illustrate. As you can see first there is only one peak. We can mark those peaks as A. In a later scanning of the sensors another peak shows up. We now assume the peaks previously known as A still correspond to each other and thus the new peaks must together form touch B.

    This would fail if more than one new touch would appear in a single reading, but depending on how the instrument is played might work.

    alt text

      Ward However, if one X peak and one Y peak appeared and another appeared later, you can make an assumption about which peaks form a touch together.

      That's an approach that could work in principle, but it may become significantly complicated reasoning to get this to work fine in all cases. A first issue is when two touches have a similar (e.g.🙂 Y value: your spatial accuracy on the Y axis will be limited because the capacitance from the two touches will interfere with each other and you won't be able to distinguish their individual contributions. Second, if touches are starting with clearly distinct values of X and Y, if they move so that they have similar values of (e.g.🙂 Y, you will have similar issues to the previous case, but - more crucially - when they move again so that they are now two distinct touches on Y, you will no longer know which Y value corresponds to which X value. With enough work (and spatial and temporal resolution), this could be made to work well in a controlled set of cases, but the reason why we don't advertise Trill Square and Hex as multitouch is precisely that it is hard (impossible?) to make it work well in all cases.

      lokki so how is multitouch done on a touchscreen?

      Normally it's done with mutual capacitance sensors. A suggestion right there for a new line of Trill sensors 🙂

      Anyhow, I think that in your case here you may be fine with your matrix idea as the two drawbacks I highlighted above shouldn't matter:

      • spatial accuracy ('first') is not an issue because positions are quantised
      • moving touches ('second') is not an issue because you are not sliding between keys (are you?) and anyhow you probably wouldn't care about "what finger is where" (i.e.: touch tracking over time), but rather only "what keys are currently pressed"

      So, as long as you don't press two buttons at "exactly" the same time (i.e.: within one sampling interval of the Trill and read interval from the host), you should be able to track what X value is associated with what Y value. Default sampling intervals on Trill are between 5ms and 7ms I think, but you can make it significantly faster by reducing the bit depth (see here).

        4 days later

        thanks for the input giuliomoro, i built a 10x17 matrix with two layers of conductive tape. i started hooking it all up but realised that i need the physical feedback of a "real" button. (as @bela_robert suggested before) so i switched all buttons to paper fasteners on my previous model, the golden ones have a brass coating and solder easily. will post a picture later.

        however i would still like to build a square like controller to use with my feet (barefoot i guess, since it won't work with shoes).

        what is the best pattern to get a trill square behaviour from a trill craft (25cmx25cm sensing area)?

        is there a way to run the square firmware on a craft? or do i need to emulate the behaviour on the receivers end?

        would it be 15 zigzags and 15 zigzags as a second layer rotated by 90 degrees? how much space between the individual copper zigzags?

        what is the pattern on the square? from the pictures it looks like straight lines, but that does not make too much sense i think.

        Looking great!

        Recreating a Trill Square from a Craft is a bit more tricky than recreating a Bar as you need each of the rows and columns of the matrix to be interlocking whilst being insulated from one another.

        On Trill Square we have a number of diamond-shaped pads on the top sensing side. This is actually of array of 15 x 15 diamonds. In one direction (down the columns) you can see that all the diamonds are connected from bottom corner to tip of the diamond below. Going across the rows the diamonds are connected via a series of vias in PCB which "weave" these two axes together. Here's a diagram illustrating that:

        alt text

        Achieving something similar to this with DIY manufacturing techniques is tricky but not impossible – personally I'd recommend using some kind of computer aided cutting of the copper tape to get a consistent pattern.

        For inspiration check out this project: https://dl.acm.org/doi/10.1145/3332165.3347895 Works in a very similar way to Trill Craft so you can just imagine your connections being made directly to the Craft channels. If you look at the second video on that page at 1.45 there is an example of cutting a pattern for the rows in copper tape using a cutter machine, fixing it to the sensing surface and then coating in PLA as an insulator, then adding a similar pattern for the columns.

        All this said, you can probably get semi decent results by simply weaving copper tape with an insulated backing together so the columns and rows intersect. Worth trying this simple solution first. You will need to apply some filtering to the readings as the shapes are not ideal but it could be all you need for your use case.

        Regarding running the firmware for Square on a Craft, that's not possible without reflashing the chip on the Craft. But it's not necessary to do this to get the Craft to behave like a Square. You can use our CentroidDetection library for this. Have a look at the custom-slider example in the Trill folder. Here you can define the exact pin numbers and their order for each axis. You can then apply the centroid detection on that custom array of pins.

        thanks, that's perfect to get me started.

        here are some pics of my "accordion" controller. one half is hooked up to a craft, the other one still to do.

        paper fasteners are the sh*t!

        alt text
        alt text

          lokki paper fasteners are the sh*t!

          how are they more "button-feely" than the upholstery nails?

            giuliomoro they are not.
            but the upholstery nails were a pain to solder to and connections kept breaking again and again while playing. Also the ones I had were a bit too big for my layout so that my fingers would sometimes slip to another one as well (hard to explain)

            Also the paper fasteners are self-holding and dirt-cheap.

            13 days later

            here is an update..both crafts connected, printed some "white" key markers to make orientation possible/easier. still undecided if i want to print black ones too, or leave it as is. 3 fsrs underneath the controller to get aftertouch, works great so far.

            alt text

            9 months later

            it is still working fine in my midi-bass. I added some black key-rings as well, and the last two inputs on one of the crafts were used for selecting the keyboard mode (midi-channel, note mode, program change mode). I also added a small oled to show the selected mode. based on how fast a finger approaches the sensor I also calculate a velocity value but that works not very consistently.

              lokki based on how fast a finger approaches the sensor I also calculate a velocity value but that works not very consistently.

              Here's a few suggestions you may find useful:

              • lower the bit rate. This will allow for faster scanning, which is crucial to get velocity.
              • tweak the prescaler. By reducing its value the "gain" of the detector is increased and so the pad will saturate more quickly. On the other hand, this increases the sensitivity, so it gives higher (and so perhaps more meaningful) values while you are approaching the pad
              • when reading trill repeatedly you may re-read the very same set of sensor readings multiple times, unless you are reading only in response to an event on the event pin. If you are reading the same set of sensor readings multiple times, make sure you distinguish between repeated and non-repeated ones and only use non-repeated ones in your velocity detector. There is no built-in way to distinguish between repeated and non-repeated ones, but you can easily do so by checking the new readings with the previous ones: if they are exactly the same, they are repeated.

                Hi, very nice instrument. I'm in a similar process right now of building a guitar with 6 Trill craft and Bela and Pd. I thought about a way to read velocities out of the pads but didn't know if it was possible or how to do it. Can I ask how you do it?

                To estimate velocity you'd need to look at the readings when the touch starts and compute the difference between successive readings. This will give an estimate of the velocity.

                14 days later

                giuliomoro There is no built-in way to distinguish between repeated and non-repeated ones,

                I'm adding that to the next firmware. Also adding a way to reduce transfer and scanning times by disabling unneeded channels and packing the results in fewer bits.