Well the T3.5 is 5 volt tolerant (if you do have to use 5v sensors etc. this can be a big advantage).
It has a lot of inputs (something like) 40 readily available from a breadboard through single headers and a few...
Teensy is not just another Arduino especially if you are making a USB MIDI compliant device but it's good to know you're not a noob to coding.
I'm always a bit skeptical when there is talk about MUX in a user's first...
1) Voltage - there is no pressing need for 5 volt for MIDI. The old Teensy 2.0 are more than adequate for MIDI controllers and they work at 5 volt but the LC is cheaper and is the obvious choice because of that.
When...
I think OP has all that sorted and wants to know how to animate the needle and draw a background image to the display... (I can't help with this)
I did find this...
...either an external ADC that accepts your range or use an op amp gain and offset circuit and regular analog read....
http://www.ti.com/lit/pdf/sloa097
Other than getting the index for the terminating character wrong the code from post 11 worked and I got the ACK back from a Teensy 2.0.
void onSysEx(byte *sysExBytes, unsigned int length){
if (sysExBytes == 0xF0 ...
I was playing with HTML today... didn't have a MIDI capable browser so I focused on building the string to paste into a MIDI utility... just leaving the WIP code here for further development.
When I'm at home with...
You need a voice management system to steal the least objectionable running voice or the first available free one. (I don't know of any examples.)
If you want to keep the built-in buttons and scale feature I think it...
Sorry... I can offer code for pots but not for encoders.
The voltage coming off a pot as a voltage divider is dead simple to use as proxy for the physical position of a pot.
Encoders have lots of advantages but...
The code in this post could be merged with the standard features of my Many buttons and knobs example to provide the feature set you indicated you want.
...
100 kOhm is very high especially for mux'd pots.
It could also be insufficient settling time between setting and reading the mux.
A cap on a mux'd pot is bad as it slows settling time.
...
Good to know, but isn't either fast enough to record mono audio provided you are buffering enough data?
For a data logging project is that fussy soldering or breakout boards really necessary? And if it is, maybe OP...
I could build you a Flowstone based editor .exe file that will work on any Windows machine like I made for my Footsy controller.... it's really easy especially as I can use mine as a template so I think I do this and...
Perhaps powering the second Teensy without connecting it to the USB of the PC might get rid of it as it seems likely (to me anyway) that the compiler is finding the wrong Teensy connected after the correct one looses...
Do you need the audio library at all? Since you've started with the audio library, we can assume the frequency you're interested in is not too high. You could just take raw analog readings every so-many micro-seconds...
It should be dead simple as a JavaScript goes. You just need to assemble the editable bytes from object.value properties into a sequence and send it on the press of a button or other object that can trigger the...
Apologies... yet again not reading carefully
The controller should be fine and the library doesn't look difficult to use.
Gibbedy's comments appear correct except the colour values are 12 bit values (stored as...
D'oh… didn't notice the colour comments... kinda undermines my comments on direct control.
Unless you really just want to alternate, in which case you can use the same signal and source one and sink the other to...
You have a choice... you can figure out how to program that part for SPI control or you can figure out how to control LED load currents via transistor switches.
No offence, but your programming skills appear a bit on...
I was adding comments to your code and thought I'd try to graft on SysEx preset config.
I don't recommend you even trying to compile this yet but I think it's only a few typos and brain-farts from working.
You...
if (flashcount>= -1*waitClocks){ // counts into negative values to supress tempo flash longer
if (flashcount> 0){ //
if (flashTimer>(flashOnTime+flashOffTime)){
//was here??
flashTimer = 0;
...
Welcome
You're not the first to miss this little nugget.
You need to read incoming midi even if you are not using them. It stops an event queue on the computer from getting bogged down with events that are never...
I'm rethinking what's needed in flashing behaviour when Tap/Bank button is used and posting this to confirm whether my intuition on the user interface agrees with yours -- and of anyone else with two-cents (CND$0.03). ...
I've been downright dangerous lately.
I'd like to blame cut and paste programming but that's just admitting laziness.
And the increment thing is stupid... even if it works it's unnecessarily obtuse compared with...
Hey... nicely spotted.
I think there's some confusion on my part. I figured it was safe to keep the light off but it would turn it off while you are in bank select.
So yes to your insight but also the conditional...
The code in 15 is tested to work with the built in LED with both a MIDI utility and two DAW...
I've rewritten your program to abstract out the active low LED wiring. The code can be set to active high or low in the...
...and I forgot how powers are written... how increment's work... and that two data bytes in MIDI is only 14 bits. Even by my standards I'm making a lot of gaffs today.
@Aussie_CrocHunter
Try this code:...
It can't since its effective limit is 16^2*6 but your point is taken...
Learned a lot here... including the commutative rule for modulo division
Thanks so much.
Yeah I should have thought about units and that the result needs to jump by six with each semiquaver.
Isn't there a risk of overloading the variable by doing the multiplication before the modulus?
Safer to have...
I think you were right the first time --> (SPP*6)%24 = SPP%4
Consider: by taking modulo 4 of the SPP we are effectively truncating to the number of 1/16 notes since the last quarter. Which is what we want to count...
So then it's zero on start and never pause?
And the convention is to run the master clock at the current tempo and to pick-up after a resume/continue command?
I feel like you can pause some software off beat so I...
So set a counter to zero on myStart and increment on myClock and flash when the modulus by 24 is zero (and reset the counter if we're not tracking the beat/measure).
Pause counting on myStop and continue from before on...
So what did you want with the clock? -- you'll need an override on the clock flash from the first TAP fallingEdge until after the second TAP is sent and for some delay time if the bank threshold is broken.
We can...
for (int i = 0; i < D_PINS ; i++){
digitalWrite(GREEN_LED_PINS, !state);
digitalWrite(RED_LED_PINS, state);
}
Add this before flashcount = bank + 1;
The negation operator might be on the wrong one again.
oops. broke D2 on the other pins...
//************DIGITAL SECTION**************
void getDigitalData(){
for (int i=0;i<D_PINS;i++){
digital.update();
if (digital.fallingEdge() || digital.risingEdge())...
Try this code buy check the pin and CC values first.
//************LIBRARIES USED**************
// 'include the Bounce library for 'de-bouncing' switches -- removing electrical chatter as contacts settle'
#include...
Ummm... I think I just forgot to make the arrays two-dimensional. The same logic that works for which button states is which should work for banks too.
That is how it was working for me. Does HIGH = LED On with...
I likely haven't thought it through... but I thought you connect a sink or source to the common side and switch the mux connections when needed.
...don't bother to explain if this is nonsense. I just don't like shift...
I did have the PINs configured for my test rig but it looks like I put them back to how I thought yours are working but I don't know where you put the mode switch or it's LED.
Can you share the configuration lines...
That's fairly slick...
I haven't been using structures with Teensyduino but seeing how easy it looks I think I might start.
@OP
The delay(5); is likely keeping this code fairly stable in its output. Without...
Yeah well I think I'd have been more surprised if it had worked. The switch logic is really all that can be wrong. Once we can set bank value then the rest will work as before... The taps we'll sort out when we're sure...
Got a chance to compile the code changes I wrote -- yikes I really need to compile as I go.
There's two major mistakes just in the matrix declaration I quoted above...
You can try this if you like but expect it...
If the TAP CC message can be sent on every downstroke and it can be the same D2 value (doesn't need off and on values) then the code should be fairly simple.
Here's an untested bit of code I'll be adding ... much of it...
Any chance you have connectors 4 and 5 switched at the DIN connector?
There is always some ambiguity in sorting out if the connector is shown from the face or connection side.
This would be ideal. Reading a few bytes of sysex and storing it in eeprom is not difficult.
I did it years ago...
https://forum.pjrc.com/threads/24537-Footsy-Teensy-2-based-MIDI-foot-pedal-controller
You read...
Here's a thing.... send no CC at tap 1 and send cc at implied location of tap three based on the interval between one and two.....
But, as you've alluded, what to do if there is a third tap as it's not going to be...
If you want a CC sent exactly when you detect the first fallingEdge you have to be OK with it being sent when it turns out your user is just trying to scroll through banks.
So when you're changing banks your DAW...
Ah... well that's outside this thread topic isn't it ;)
The logic isn't all that hard. If there is a risingEdge within x milliseconds after the fallingEdge change the mode (recall with monentary-on switch and a...
This sound's like I have the HIGH/LOW backwards as I thought I might. Try this:
digitalWrite(RED_LED_PINS, state);
digitalWrite(GREEN_LED_PINS, !state);
The exclamation point means negate or...
Forgot to switch the LEDs with the toggle...
Something like this
//************DIGITAL SECTION**************
void getDigitalData(){
for (int i=0;i<D_PINS;i++){
digital.update();
...
I don't imagine the LED thing is a problem but is worth a note in the code so anyone working on the code down the road understands why.
Have you tried the code with state = !state ; active as well as the...
To have it read changes from software but not be dependant on feedback otherwise we just need to leave the toggle code active but still allow the state to be set in the onControlChange().
I think that means we...
I assumed you have MIDI feedback available and active in your software.
But I think I see how it should work if feedback is not running... but I have to work now...
Well its all based on the assumption that the daw sends back confirmation... the whole point of not just letting the switch state determine off and on.
But it could be I've messed up the logic on state values. Not...
Tested with a ground wire on pins 0 to 3 and the toggle worked with the negated assignment uncommented (and missing semicolon added and single equal sign changed to assignment double).
Don't have hardware for LED...
The LEDs are at least in part from failing to put the pins in output mode.
It was optimistic to think it would be close but it was in part to make it easier to get at from a machine I can get Teensyduino on...
I'm...
If it's only a problem when the output from the guitar is "quiet" and the noise source is from the ADC then one could use an envelop follower from the input level and gate the signal when quiet.
If you have high gain...
Here's the bit you need to comment out if the DAW thing doesn't work to set the toggle state.
// usbMIDI.setHandleControlChange(OnControlChange)
Alternately you can leave the handler run but comment out the...
Some latching footswitches don't sit as high when latched and releasing it feels different from setting it.
Personally I would make the DAW listen to the switch instead. If the switch is on, set the parameter in the...
Let's not talk about any of your code as I believe you have made a fundamental error in understanding what it's doing.
It is clear to me you have not understood how it works and have muddled a number of my variables...
I don't think there is any point in me trying to understand your code as I'm pretty sure you don't. I think you're not getting how his timing system is meant to work.
Did you have something working before you added...
That FSR code is using the main loop speed as a timing feature.
Polling for elapsed time is preferred.
Also I think some of your changes may be obscuring how this is supposed to work.
Can you point to the...
That modified code was to implement toggle behaviour with momentary switches.
If you have toggle switches the stock many-button-and-knobs sketch should work by just replacing the note on/off commands with CC messages...
So are you committed to the latching switches?
Regardless the LED/DAW feedback feature (assuming your DAW is echoing back the received CC messages??) should be easy to convert to arrays and to integrate back into...
You might want to ignore the LEDs at first and when you go to add them perhaps you will want to use arrays since you have them for other elements of your sketch.
Usually one would use momentary switches for this.
...