Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
vberthiaume committed Jan 7, 2025
1 parent f98fc2c commit bca9c96
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 37 deletions.
5 changes: 0 additions & 5 deletions exampleProjects/touch/.gitignore

This file was deleted.

12 changes: 6 additions & 6 deletions include/puara/descriptors/touch.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ class Touch
{
public:
static constexpr int maxNumBlobs = BlobDetector::maxNumBlobs;
float touchAll{}; // f, 0--1
float touchTop{}; // f, 0--1
float touchMiddle{}; // f, 0--1
float touchBottom{}; // f, 0--1
float touchAll{}; // f, 0--1
float touchTop{}; // f, 0--1
float touchMiddle{}; // f, 0--1
float touchBottom{}; // f, 0--1

/** brush: direction and intensity of capsense brush motion in ~cm/s (distance between stripes = ~1.5cm) */
float brush{}; // f, 0--? (~cm/s)
float brush{};
Brush brushes[maxNumBlobs];

/** rub: intensity of rub motion in ~cm/s (distance between stripes = ~1.5cm) */
float rub{}; // f, 0--? (~cm/s)
float rub{};
Rub rubs[maxNumBlobs];

// touch array
Expand Down
52 changes: 26 additions & 26 deletions include/puara/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,6 @@ inline unsigned long long getCurrentTimeMicroseconds()
return duration.count();
}

/**
* @brief Legacy function used to calculate 1D blob detection in older
* digital musical instruments
*/
inline void bitShiftArrayL(int* origArray, int* shiftedArray, int arraySize, int shift)
{
for(int i = 0; i < arraySize; ++i)
{
shiftedArray[i] = origArray[i];
}
for(int k = 0; k < shift; ++k)
{
for(int i = 0; i < arraySize; ++i)
{
if(i == (arraySize - 1))
{
shiftedArray[i] = (shiftedArray[i] << 1);
}
else
{
shiftedArray[i] = (shiftedArray[i] << 1) | (shiftedArray[i + 1] >> 7);
}
}
}
}

/**
* @brief Computes the average of elements in an array over a specified range.
*
Expand Down Expand Up @@ -140,6 +114,32 @@ inline double arrayAverageZero(T* Array, int ArraySize)
return output;
}

/**
* @brief Legacy function used to calculate 1D blob detection in older
* digital musical instruments
*/
inline void bitShiftArrayL(int* origArray, int* shiftedArray, int arraySize, int shift)
{
for(int i = 0; i < arraySize; ++i)
{
shiftedArray[i] = origArray[i];
}
for(int k = 0; k < shift; ++k)
{
for(int i = 0; i < arraySize; ++i)
{
if(i == (arraySize - 1))
{
shiftedArray[i] = (shiftedArray[i] << 1);
}
else
{
shiftedArray[i] = (shiftedArray[i] << 1) | (shiftedArray[i + 1] >> 7);
}
}
}
}

namespace convert
{

Expand Down

0 comments on commit bca9c96

Please sign in to comment.