element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
MusicTech
  • Challenges & Projects
  • Design Challenges
  • MusicTech
  • More
  • Cancel
MusicTech
Blog Kazumi - 04 - Implementing Capacitive Touch
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: luiszayas
  • Date Created: 28 Feb 2016 4:23 PM Date Created
  • Views 549 views
  • Likes 1 like
  • Comments 0 comments
  • music tech
  • music_tech
  • mtc
  • bbb
  • project_kazumi
  • musictech
  • music
  • music-tech
  • kazumi
Related
Recommended

Kazumi - 04 - Implementing Capacitive Touch

luiszayas
luiszayas
28 Feb 2016

Hello,

 

Today I am going to show you how I have managed to use capacitive touch in conjunction with the piezo transducer to enable pitch changes within a pad.

 

In the example I was given at QMUL for using MPR121s, a sine wave of different frequencies plays every time a different electrode is touched. However, in order to have all of the control on the Pure Data side of things, I wanted to send a raw data stream, same as I had been doing with the Raspberry Pi in the old setup.

 

Luckily, I found a couple of commented out lines for debugging that did exactly that and printed the data. With some help from Chris at Enzien Audio, I managed to turn this into a message that could be interpreted by Heavy audio tools and sent into my compiled pure data patch. Then in Pure Data, I would be able to receive those values and use them for anything I could think of (within the possible).

The function looks like this:

void readMPR121()
{
  for(int i = 0; i < NUM_TOUCH_PINS; i++) {
  sensorValue[i] = -(mpr121.filteredData(i) - mpr121.baselineData(i));
  sensorValue[i] -= threshold;
  if(sensorValue[i] < 0)
  sensorValue[i] = 0;
        hv_vscheduleMessageForReceiver(gHeavyContext, "sensorValues", 0, "ff", (float)i, (float)sensorValue[i]);
  }
}

 

For now, all I wanted is to check this worked so I made each electrode send a different frequency to the KarplusStrong patch I was already using. This is how it looks on Pure Data:

 

image

 

And this is what it sounds like:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Not a bad start. The next steps are getting all four MPR121s to work simultaneously (by giving them different I2C addresses) and setting rules for multi-touch within each pad (like playing a chord when more than 2 electrodes are touched at the same time).

 

On another note, Bela platform gets released on Kickstarter tomorrow so make sure to check Bela.io!

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube