Show Posts
Pages: [1] 2 3 ... 16
1  Using Arduino / Installation & Troubleshooting / Re: Arduino reference sources on: July 02, 2014, 09:13:57 am
I have found that GitHub allows to filter issues for Documentation so that seems to solve the commenting part. But not how to fork, update, and send pull request.
2  Using Arduino / Installation & Troubleshooting / Re: Arduino reference sources on: July 01, 2014, 10:49:40 am
Thanks for the reply. Yes, I'm aware that Arduino installs a local copy.

My question was, where are those references maintained. Where can I track changes, propose updates, etc. If the source in GitHub is a zipfile, it is clearly not maintained there but elsewhere.
3  Using Arduino / Installation & Troubleshooting / Arduino reference sources on: June 30, 2014, 12:49:18 pm
Where abouts are the Arduino reference sources maintained? I know the Arduino code is on GitHub; for the 1.0.x branch there is a zip of the references in Arduinio / build / shared. I thought maybe they were maintained under the 1.5.x beta codebase but similarly, Arduinio / build / shared just has a zipfile.

In addition, both of these zips indicate a last change two years ago, and I assume the online version must be more recent.
4  Using Arduino / Audio / Re: All inputs (analog/digital) to class compliant MIDI firmware? on: August 30, 2013, 05:53:06 am
Ok, so I found this which looks pretty good. I've not messed with Teensy's at all, so don't know how different it is to 'regular' Arduino stuff.
http://www.pjrc.com/teensy/td_midi.html

Yes, each of the Teensy models has a good USB stack which includes USB MIDI (class compliant) as well as USB Keyboard, mouse, etc. The USB mode is chosen with a menu option.

In terms of compatibility the Teensy 2 and Teensy ++2 are both AVR-based so code that works on an Arduino Uno will likely work there; a major difference is that Serial (over USB to the serial monitor) and Serial1 (using Tx and Rx) are independent 9so you can use both at once, unlike Arduino).

Teensy 3.0 uses a fast, 96MHz ARM chip so it is more like the Arduino Due. Except you can use the Arduino 1.0.5 with it, its not restricteed to 1.5.x.

There are a lot of libraries available, which either work as-is or have been ported to add Teensy support or have been specially written for Teensy.

Its a good choice for a USB Midi device.
5  Using Arduino / Audio / Re: Velocity Sensitivity with non-MIDI Keyboard on: July 18, 2013, 02:01:36 pm
That sounds like polyphonic aftertouch, not velocity.
6  Using Arduino / Audio / Re: Bandlimited waveform generation on: May 15, 2013, 04:13:59 am
Maybe it is a language thing but you do not understand what you are saying.

I believe I understand the words digital and synthesis fairly well. And bandlimited synthesis is a fairly well established concept.

However, if you are of the opinion that it is all a waste of time and totally unnecessary (and able to demonstrate this), perhaps you should publish your insight in a peer reviewed academic paper?
7  Using Arduino / Audio / Re: Bandlimited waveform generation on: May 14, 2013, 02:06:57 pm
Quote
Sorry, that is incorrect.
No I don't think you understand those papers.
How were those spectrums obtained? By digitising the signal.

If by digitising you mean starting with an analog signal and then sampling it (the usual meaning) then no. There is no analog to digital conversion in this process. The digital signal produced is created directly in the digital domain. hence the name Direct Digital Synthesis.

It says:-
Quote
Any analog signal with a discontinuity in the wave- form (such as pulse train or sawtooth) or in the waveform slope (such as triangle wave) must be bandlimited to less than half the sampling rate before sampling to obtain a corresponding discrete-time signal. Simple methods of generating these waveforms digitally contain aliasing due to having to round off the discontinuity time to the nearest available sampling instant. The signals primarily addressed here are the impulse train, rectangular pulse, and sawtooth waveforms. Because the latter two signals can be derived from the first by integration, only the algorithm for the impulse train is developed in detail.
My red words.

My pink ones.
8  Using Arduino / Audio / Re: Bandlimited waveform generation on: May 14, 2013, 05:42:42 am
Quote
When producing these digitally, these harmonics are above the nyquist frequency and aliase back into the audio frequency sometimes.
No they don't.
Aliasing only occours when you sample a signal not when you generate it.

Sorry, that is incorrect.

Its perfectly possible to create an aliased signal using DDS to create a waveform (square, sine, or whatever does not matter) and its well known how to avoid this by creating bandlimited signals. The typical way it is done in practice is to use multiple wavetables, such as one per octave, with each table containing progressively less harmonics. Although this can produce audible artifacts on rapid frequency sweeps.

A useful introduction is the paper by Stilson & Smith Alias-Free Digital Synthesis of Classic Analog Waveforms
https://ccrma.stanford.edu/~stilti/papers/blit.pdf

These lecture notes on bandlimited synthesis are also helpful
http://www.music.mcgill.ca/~gary/307/week5/bandlimited.html

This discussion includes sample code
http://slack.net/~ant/bl-synth/

All of these assume that the analog DDS waveform is being produced by a DAC, rather than messing around with optimistic pulse width modulation hackery.
9  Using Arduino / Audio / Re: MIDI Note On/Off Messages on: April 28, 2013, 12:18:00 pm
it does, yes. Did you try it?

I notice that its still only one button, and that you actually want 9 buttons. I also saw some variable names like button2, button3 etc in your earlier code. Do you know about arrays?
10  Using Arduino / Audio / Re: MIDI Note On/Off Messages on: April 27, 2013, 05:27:43 am
Your code is constantly detecting the state of each button and always sending a MIDI message. Instead, you should be looking for a change of state (on to off, or off to on). For each button, save the state. When reading the state, compare it to the value last time the loop and only send a MIDI message if the value has changed. Then set the saved state to the current reading.
11  Using Arduino / Microcontrollers / Re: Arduino Mega2560 R3 pinouts photo on: April 11, 2013, 08:27:47 am
Ah, I hadn't thought of it like that but I can see how it could be read that way. I will move the "5V pins" label and make it clearer.
12  Using Arduino / Audio / Re: Velocity Sensitivity with non-MIDI Keyboard on: March 25, 2013, 02:19:13 am
You are right (I think) with diodes to stop cross-talk between the switches, I suppose it is the same as multiplexing a 64-segment LED display, except in reverse. Oh well, that makes it nice and simple. A few shift registers or a couple of 16-port port-expanders and you should be able to interrogate all 128 combinations fairly quickly.

On the diodes, here are some keyboard wiring diagrams of the Fatar keyboards used in a number of commercial keyboards:
http://www.doepfer.de/DIY/MKE_keyboards.htm

13  Using Arduino / Audio / Re: Velocity Sensitivity with non-MIDI Keyboard on: March 25, 2013, 12:13:43 am
One possibility is a matrix (like a keypad) but you will throw away polyphony doing that.

Nick, could you explain that point further? I don't see any way that matrix scanning (which is the standard method for keyboards since the 60's) is incompatible with polyphony, as long as the switch matrix incorporates diodes which they all seem to do.
14  Using Arduino / Audio / Re: Velocity Sensitivity with non-MIDI Keyboard on: March 25, 2013, 12:09:10 am
I haven't really tried this so I would do a few more searches on the topic of something like "velocity sensitive midi arduino".

Unfortunately, doing so will turn up lots of forum posting, blog posts etc about scanning the matrix of keys (a 61 key keyboard is typically wired as a 8x8 matrix, with diodes to cope with the ambiguity of multiple keypresses, so it is similar to decodin a matrix keypad) with code which uses only one set of switches per key, then ends lamely with "and the velocity is just a fixed value in my code for now, I will add velocity sensing later" followed by the end of the thread  smiley-roll-blue

Not having done this either, but planning to - the top set of switches is an 8 rows by 8 columns matrix; the bottom set is an 8 rows by 8 columns matrix. As far as I can see the rows can be shared between the two, so you loop through rows, output a signal per row and scan both sets of columns. That adds up to 24 pins (or less pins, if a serial-to-parallel latching port expander like 74HC595 is used to generate 8 rows from 3 pins). If the columns can use pins that correpond to a contiguous set of 8 on one port, then port reads can be used to read the entire column at once.

For a velocity sensitive keyboard you would need to maintain a key state array with a entry for each key, based on the two scan results for upper and lower switches. The key states are:

1) unpressed (upper and lower open)
2) press started (upper closed, lower open)
3) press complete  (upper and lower closed) (sample aftertouch)
4) release started (upper closed, lower open)
5) release finished (upper and lower open)

Looking at those key states they are defined not only by the upper and lower switch states but also by whether they key is rising or falling i.e. the previous state.

The normal sequence of key state transitions is 1, 2, 3, 4, 5, 1. Code should also cope with 1, 2, 1 (the key starts to depress but then goes up again, no MIDI generated) and 4,3,4 (key starts to rise but then goes back to fully depressed, no MIDI generated).

At states 2 and 4 you would want to get the current time (millis) and store it. I believe the two times could use the same array location.

At states 3 and 6 you would want to get the current time (millis), compare it to the stored time, and then compute the velocity which is usually a 7-bit value where 1 is very soft (a long tie between the two switches) and 127 is hard (a  fast time between the two switches). Zero has a special meaning (a Note-On with velocity of zero means Note-Off). You would need to decide a minimum and maximum time to map to 1 and 127. This could be a linear relatinship or you could allow various velocity curves.

Then a state 3 you send Note-On with velocity and go to state 4. At state 6 you send Note-Off with velocity and go to state 1.

To cope with poor quality, easily confused lowest-common-denominator MIDI implementations I would also suggest providing the option to skip measuring the key release velocity and instead send Note-On with velocity zero at stage 6. This is for three reasons; firstly many synthesizes etc don't do anythng with release velocity so there is no benefit to measuring it; secondly if using MIDI-over-DIN your bandwidth is very limited and sending a sequecnce of Note-On v followed by Note-On 0 allows runing status so you only send the status byte once. (This does not apply to MIDI-over-USB which does not need, or indeed allow, runnin status and has ample bandwidth, 12Mbits instead of 31kbits). Thirdly, some poor implementations not only won't use release velocity but are actually confused by it and will not register a note-off. These are thankfuly rare.

If your keyboard has a single pressure sensor, then you can also measure and send Channel Aftertouch during key stage 3. And if you are building your own keyboard and have lots of money for 61 pressure sensors plus ADC multiplexing circuitry, then you could measure and send Polyphonic Aftertouch at stage 3.
15  Using Arduino / Audio / Re: Velocity Sensitivity with non-MIDI Keyboard on: March 24, 2013, 11:16:11 pm
The 122 switches give velocity information by comparing the timing between the two buttons for each key, which are spaced at slightly different depths. I'm surprised it works with any reliability, but apparently it does well enough and is a pretty common design for simple keyboards:
http://www.openmusiclabs.com/learning/digital/input-matrix-scanning/keyboard/

Its the standard design for most keyboards with velocity sensitivity.
Pages: [1] 2 3 ... 16