Positional sensing testing
Posted: Sat May 08, 2010 12:40 am
This is a version of MegaDrum firmware for testing positional sensing on mesh type pads. There are a few prerequisites and limitations:
1. Test means test. Don't expect it to work with everything, with default settings, in all circumstances. It can be buggy and may cause your MegaDrum to explode.
2. It will only work on a snare input.
3. The pad must not be too hot. If it is too hot it must be "cooled" with a voltage divider.
4. The first half wave of a signal from a pad should be positive, e.g my Pintech mesh snare is such pad. Most of other mesh pads out there, like Roland, Drumtec and etc, produce a negative first half wave. This is a schematic of a precision rectifier required for such pads (a Pintech mesh snare will of course work with it as well):
As you can see, this precision rectifier works with a single +5 power supply. To achieve this the opamp must meet these requirements:
1. able to operate at below zero input
2. rail-to-rail output
3. has no phase inversion
I've tested it with LMC6034, ~£1.00 at Farnell (LMC6032 will also work of course but the pinout is different)
If the opamp is also "unity gain stable", e.g. LM6134 (~£3.00 at Farnell), then C3 and C4 can be omitted.
(Can you suggest a cheaper alternative to LM6134?)
This is the firmware to use for the test:
It has 3 new options added:
1. Positional. (Default is No).
2. PositionalLow. (Default is 5).
3. PositionalHigh. (Default is 15).
To enable positional sensing on the snare input set Positional to 1, 2 or 3 (corresponding to three variations of the positional sensing).
PositionalLow and PositionalHigh are adjusted so that to get a full range of detected positions (and MIDI CC messages) from a rim (PositionalLow) to a centre (PositionalHigh). The default PositionalLow and PositionalHigh are good starting values for Roland PD-125X with Positional set to 1.
When Positional set to 2 the good starting values for Roland PD-125x are 16 and 30. With Positional set to 2, MinScan must be set so that to cover a full half wave which is 40 (4ms) for Roland PD-125X.
Positional set to 3 is almost the same as 2 but with slightly different algorithm so you may need to set PositionalLow and PositionalHigh slightly higher.
For the Drumtec snare the good starting values for PositionalLow and PositionalHigh are 5-10 higher than for Roland PD-125X.
You can also enable some debugging if you set Latency to an odd value (...,37,39,41,... ) . In the top row of the LCD it will show relative position of the hit as calculated by MegaDrum: ^ symbol shown more to the left for centre hits and more to the right for close to rim hits.
In the bottom row it will show 3 values with every hit: the first is used for calculating position when Positional is set to 1, second - when Positional is set to 2 and third - when Positional set to 3. Use these values to adjust PositionalLow and PositionHigh.
1. Test means test. Don't expect it to work with everything, with default settings, in all circumstances. It can be buggy and may cause your MegaDrum to explode.
2. It will only work on a snare input.
3. The pad must not be too hot. If it is too hot it must be "cooled" with a voltage divider.
4. The first half wave of a signal from a pad should be positive, e.g my Pintech mesh snare is such pad. Most of other mesh pads out there, like Roland, Drumtec and etc, produce a negative first half wave. This is a schematic of a precision rectifier required for such pads (a Pintech mesh snare will of course work with it as well):
As you can see, this precision rectifier works with a single +5 power supply. To achieve this the opamp must meet these requirements:
1. able to operate at below zero input
2. rail-to-rail output
3. has no phase inversion
I've tested it with LMC6034, ~£1.00 at Farnell (LMC6032 will also work of course but the pinout is different)
If the opamp is also "unity gain stable", e.g. LM6134 (~£3.00 at Farnell), then C3 and C4 can be omitted.
(Can you suggest a cheaper alternative to LM6134?)
This is the firmware to use for the test:
It has 3 new options added:
1. Positional. (Default is No).
2. PositionalLow. (Default is 5).
3. PositionalHigh. (Default is 15).
To enable positional sensing on the snare input set Positional to 1, 2 or 3 (corresponding to three variations of the positional sensing).
PositionalLow and PositionalHigh are adjusted so that to get a full range of detected positions (and MIDI CC messages) from a rim (PositionalLow) to a centre (PositionalHigh). The default PositionalLow and PositionalHigh are good starting values for Roland PD-125X with Positional set to 1.
When Positional set to 2 the good starting values for Roland PD-125x are 16 and 30. With Positional set to 2, MinScan must be set so that to cover a full half wave which is 40 (4ms) for Roland PD-125X.
Positional set to 3 is almost the same as 2 but with slightly different algorithm so you may need to set PositionalLow and PositionalHigh slightly higher.
For the Drumtec snare the good starting values for PositionalLow and PositionalHigh are 5-10 higher than for Roland PD-125X.
You can also enable some debugging if you set Latency to an odd value (...,37,39,41,... ) . In the top row of the LCD it will show relative position of the hit as calculated by MegaDrum: ^ symbol shown more to the left for centre hits and more to the right for close to rim hits.
In the bottom row it will show 3 values with every hit: the first is used for calculating position when Positional is set to 1, second - when Positional is set to 2 and third - when Positional set to 3. Use these values to adjust PositionalLow and PositionHigh.