News:

Forum may be experiencing issues.

Main Menu

Dual PT2399 with tap tempo

Started by Marshall Arts, March 23, 2016, 12:48:04 PM

Previous topic - Next topic

blearyeyes

This is a great idea. Taptation has been a thorn in my side. I've been thrown off of two forums because I can't get a straight answer about how to make it accurate. Touchy subject for people who sell the stuff I guess. So this project would be a God send!

How much do you have tied up in parts if you don't mind me asking? I don't know what an Arduino costs.

nzCdog

Quote from: blearyeyes on March 24, 2016, 02:35:19 AM
This is a great idea. Taptation has been a thorn in my side. I've been thrown off of two forums because I can't get a straight answer about how to make it accurate. Touchy subject for people who sell the stuff I guess. So this project would be a God send!

How much do you have tied up in parts if you don't mind me asking? I don't know what an Arduino costs.

http://www.ebay.com/sch/i.html?_from=R40&_trksid=p2047675.m570.l1313.TR0.TRC0.H0.Xarduino+nano.TRS0&_nkw=arduino+nano&_sacat=0 ;D

blearyeyes

Last time I wandered through Arduino land  I don't think they had these little guys.  Wish I knew more about programming.

Marshall Arts

Quote from: blearyeyes on March 24, 2016, 02:35:19 AM
This is a great idea. Taptation has been a thorn in my side. I've been thrown off of two forums because I can't get a straight answer about how to make it accurate. Touchy subject for people who sell the stuff I guess. So this project would be a God send!

How much do you have tied up in parts if you don't mind me asking? I don't know what an Arduino costs.

Thanks - I just would like to mention that I dont want to compete with anything out there or endanger somebodys business, I am not planning to get rich on this and I see this simple as an addition to the community, developed for myself, provided to the community. Once I publish the code, I will make it available under creative commons (or similar) license models, so nobody else will get rich on it either. Actually, I doubt that anybody in this diy-community gets rich on these things at all, including all our heroes (madbean and so on). The market is too small for this. We are all just here for fun, right?!

Known drawbacks over existing solutions:

  • I guess it will be a bit bigger than e.g. taptation, so it might be tricky to squeeze it in one box together with a given delay.
  • In order to make it run, you will have to upload code to an arduino and calibrate it. This should be straightforward, but with some arduinos (china copies), you might have (solvable) driver issues.
  • Sourcing some parts may be tricky. I guess that is the reason why I have seen other solutions being sold together with the digital pot (I dont plan to make a business out of this, so I will not offer bundles). See "costs" below...

Costs/Sourcing:

  • An Arduino is 5$ (1 required), digital encoders (0-3 required) are 1.50$ (plastic) through 3$ (metall), digital pots (2 required) are 1.50$. Including the PCB the total costs will be comparable or higher to other solutions out there.
  • Sourcing some of the parts might be tricky: At least in Germany it is tricky to find a supplier, that does not ask for a minimum quantity (http://rs-online-privat.de/), does not kill the project by shipping costs (mouser) and holds all of the components (so you dont have to order at separate places). Maybe someone can spend some time on the internet and search for appropriate suppliers, this will be outside of the portfolio of our standard suppliers (tayda, smallbear, you-name-it). We would need:

samhay

Quote from: mfunky on March 23, 2016, 04:05:20 PM
Quote from: samhay on March 23, 2016, 03:38:08 PM
What's the minimum delay you can get with this setup - my guess is that the 'shaky ground' will add substantially to this?

I have a physical switch to switch off modulation completely. I don't know how short the delay is with a minimal setting (there is some), but it is not audible (so, way below a slapback). It adds just a bit of "space" to the tone. I will post a video to give you a better idea.

excellent - looks like a cool design

Marshall Arts

#20
I have finished the first official release this morning, which I have been working on (with major breaks) for about half a year now. I am thrilled! As promised, I share this with the community with this post. I will spend the next days with designing a PCB from this and I would like to share the leftovers with the community as well (once they arrive and have been tested, couple of weeks...). I would therefore kindly ask you guys to not build PCBs from this yet. Everything is licensed under creative commons SA.

Here is the package! Happy easter!

Code and Schematic:
Attached.

selfdestroyer

I am very interested in this project. Thanks so much for putting this together and offering it to the community. I would love to see more people jump on the Arduino train since there are so many possibilities for some cool projects..this one included.

I bought everything from Mouser minus the Arduino, since I have some already to play with.

For the encoder I found the Bourns PEC12R-3220F-S0024
579-MCP41050-I/P
579-MCP41010-I/P
579-MCP41100-I/P

Hope to have the parts by Saturday and can get something breadboarded out to play with. I have a populated Deep Blue to play with.

Thanks
Cody

Marshall Arts

Cody - that is very cool! For the beginning, connect the arduino to the input and output of the delay and run the "calibrate" program. Obey the instructions in the beginning of the code. You can use the "read eeprom" program to check everything went fine - your delay times should be stored at eeprom location 5, 10, 15,...and so on.

If you were successful with that, the rest will be easy (I guess). Cant wait for the first implementation outside my house...

Best,
Matthias

daleykd

Would it be possible to design this board without buying the Arduino board itself and just get the microcontroller?  Er, in essence, instead of a shield, create an all-in-one?

selfdestroyer

Looking at your code, which is super clean by the way and easy to follow. A few questions:

What momentary switches you using? Do you get much miss-punches on them? I notice you are using debounce but do you think something like Bounce2.h library would suite this project better? I have used the library in a few projects I am working on and it seems to really help with miss fires and switch chatter.

This is a simple use of it to send a midi note when button1_pin is held down:

void setup() {
  // put your setup code here, to run once:
  pinMode(button1_pin, INPUT);    // declare pushbutton as input
  digitalWrite(button1_pin, HIGH); // Enabling a pull-up resistor
  debouncer.attach(button1_pin); // setup the Bounce instance
  debouncer.interval(5); // Bounce interval in ms
  pinMode(led1_pin, OUTPUT);  // declare LED as output
  Serial.begin(31250);    // Set baud rate for MIDI
  MIDI.begin();
}

void loop(){
  debouncer.update(); // Update the Bounce instance
  int lastButtonState = debouncer.read(); // Get the updated value
  if (lastButtonState == HIGH) {         // check if the input is HIGH (button released)
    digitalWrite(led1_pin, LOW);  // turn LED On
    MIDI.sendNoteOn(69, 127, 1);
    // byte data[] = { 0xF0, 0x7F, 0x00, 0x06, 0x02, 0xF7 };
    MIDI.sendSysEx(10, data, true);
  } else {
    digitalWrite(led2_pin, LOW);  // turn LED On
    digitalWrite(led1_pin, HIGH);  // turn LED Off
  }
}


Also wondering if a change state of falling edge would be more consistent on  tapbuttonpin with a mechanical switch.

I'm not very competent in this as I am still learning, just want to hear your thoughts.

Cody

Marshall Arts

Quote from: daleykd on March 24, 2016, 06:01:45 PM
Would it be possible to design this board without buying the Arduino board itself and just get the microcontroller?  Er, in essence, instead of a shield, create an all-in-one?

Sure - you would have to do the programming e.g. of an atmega328 in a programmer (e.g. an arduino nano). Get the bootloader on it first, of course. And then build the bits and pieces around it (e.g. reset, if you need one, DC stabilization, buffering,...). There is enough documentation around how to do it. I just wanted to use the nano, because it has an USB port and I WILL change/update the program frequently ;-)

If you build it, share it!

selfdestroyer

Quote from: daleykd on March 24, 2016, 06:01:45 PM
Would it be possible to design this board without buying the Arduino board itself and just get the microcontroller?  Er, in essence, instead of a shield, create an all-in-one?

This is something I was just reading on also.

http://www.instructables.com/id/Honey-I-Shrunk-the-Arduino-Moving-from-Arduino-t/

It links a great chart to compare with:
https://en.wikipedia.org/wiki/Atmel_AVR_ATtiny_comparison_chart

Cody

Marshall Arts

Quote from: selfdestroyer on March 24, 2016, 06:12:30 PM
Looking at your code, which is super clean by the way and easy to follow. A few questions:

What momentary switches you using? Do you get much miss-punches on them? I notice you are using debounce but do you think something like Bounce2.h library would suite this project better? I have used the library in a few projects I am working on and it seems to really help with miss fires and switch chatter.

This is a simple use of it to send a midi note when button1_pin is held down:

void setup() {
  // put your setup code here, to run once:
  pinMode(button1_pin, INPUT);    // declare pushbutton as input
  digitalWrite(button1_pin, HIGH); // Enabling a pull-up resistor
  debouncer.attach(button1_pin); // setup the Bounce instance
  debouncer.interval(5); // Bounce interval in ms
  pinMode(led1_pin, OUTPUT);  // declare LED as output
  Serial.begin(31250);    // Set baud rate for MIDI
  MIDI.begin();
}

void loop(){
  debouncer.update(); // Update the Bounce instance
  int lastButtonState = debouncer.read(); // Get the updated value
  if (lastButtonState == HIGH) {         // check if the input is HIGH (button released)
    digitalWrite(led1_pin, LOW);  // turn LED On
    MIDI.sendNoteOn(69, 127, 1);
    // byte data[] = { 0xF0, 0x7F, 0x00, 0x06, 0x02, 0xF7 };
    MIDI.sendSysEx(10, data, true);
  } else {
    digitalWrite(led2_pin, LOW);  // turn LED On
    digitalWrite(led1_pin, HIGH);  // turn LED Off
  }
}


Also wondering if a change state of falling edge would be more consistent on  tapbuttonpin with a mechanical switch.

I'm not very competent in this as I am still learning, just want to hear your thoughts.

Cody

Cody - you are really going into this, I see - awesome! I reused the debounce routine from my Linda looper (http://www.diystompboxes.com/smfforum/index.php?topic=112106.0), and it does not produce any wrong results even with the cheapest buttons. But probably the code would be easier to read with the lib you mentioned (it looks like, I admit). Does it work with long presses as well? Do it, share it!

And thanks for the compliment on the readability of the code - I always wanted to publish that, so I tried to comment as much as possible.

Marshall Arts

Quote from: selfdestroyer on March 24, 2016, 06:50:53 PM
Quote from: daleykd on March 24, 2016, 06:01:45 PM
Would it be possible to design this board without buying the Arduino board itself and just get the microcontroller?  Er, in essence, instead of a shield, create an all-in-one?

This is something I was just reading on also.

http://www.instructables.com/id/Honey-I-Shrunk-the-Arduino-Moving-from-Arduino-t/

It links a great chart to compare with:
https://en.wikipedia.org/wiki/Atmel_AVR_ATtiny_comparison_chart

Cody

Cool! But be aware that there is some tricky bits in my code: I had to modify the multipliers for PWM on the modulation (and RGB LED) pins to prevent audible interference. This messes up some internal timers and has some other side effects (e.g. when you switch on Serial communication, SPI to the MCPs does not work correctly). I learned that pins on the IC are grouped (pin pairs), so when using a more tiny IC (with shift registers), this might become really tricky. Not saying its not possible, but the nano with its smd chip is rather small already, I doubt that you can achive a smaller build with the same amount of pins (I use ALL)...

TalkingStrings

#29
http://uk-electronic.de/onlineshop/index.php?osCsid=e667159f6be43fc52b5fd9ee08751f34

This looks to be an all around good option for components, almost independent of your location. I have'nt completed an order yet, but I have a cart full that I need to go ahead and close on.