Compare commits

..

No commits in common. "a745768f9b5fd19c58cb2d65d264392912d7b615" and "cac554cc1c58d7ae43da3e1d2cf7ab59ba8dc8a0" have entirely different histories.

3 changed files with 22 additions and 27 deletions

View File

@ -3,7 +3,6 @@ project(trakker)
SET(CMAKE_CXX_STANDARD 17) SET(CMAKE_CXX_STANDARD 17)
SET(CMAKE_CXX_STANDARD_REQUIRED True) SET(CMAKE_CXX_STANDARD_REQUIRED True)
SET(CMAKE_CXX_FLAGS "-O3") SET(CMAKE_CXX_FLAGS "-O3")
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
include_directories(${CMAKE_BINARY_DIR}) include_directories(${CMAKE_BINARY_DIR})
find_package(Git) find_package(Git)
find_package(ALSA REQUIRED) find_package(ALSA REQUIRED)

View File

@ -17,7 +17,7 @@
static std::string note_name[] = { "C ", "C#", "D ", "D#", "E ", "F ", "F#", "G ", "G#", "A ", "A#", "B " }; static std::string note_name[] = { "C ", "C#", "D ", "D#", "E ", "F ", "F#", "G ", "G#", "A ", "A#", "B " };
static std::string pages[] = { "1. Info", "2. Pattern", "3. Scope", "4. Piano Roll", "5. Config", "6. Help" }; static std::string pages[] = { "1. Info", "2. Pattern", "3. Scope", "4. Piano Roll", "5. Config", "6. Help" };
static const char* device = "default"; static char* device = "default";
char* file; char* file;
bool colorMode = 0; // 0 - Auto, 1 - Monochrome, 2 - 8-bit, 3 - Full bool colorMode = 0; // 0 - Auto, 1 - Monochrome, 2 - 8-bit, 3 - Full
@ -633,30 +633,26 @@ int lerp (int a, int b, float f) {
#include <vector> #include <vector>
std::vector<int> bufbuf; std::vector<int> bufbuf;
void displayScope(xmp_module_info *mi, xmp_frame_info *fi) { void displayScope(xmp_module_info *mi, xmp_frame_info *fi) {
bufbuf.resize(fi->buffer_size);
const char* xbuf = (char*)fi->buffer; const char* xbuf = (char*)fi->buffer;
int percol = (fi->buffer_size/(COLS-2)); float nxcol = 0;
bufbuf.resize(COLS-2); int rate = 2;
int midLine = (LINES-4)/2;
wmove(dis, 0, 0); int horzInc = 1;
for (int s = 0; s < COLS-2; s++) { for (int s = 0; s < fi->buffer_size; s++) {
int colsum = 0; if (nxcol >= COLS-2) break;
for (int v = 0; v < percol; v++) { int l = lerp(bufbuf[s], lerp(xbuf[s-rate], xbuf[s], 0.5f), 0.5f);
colsum += xbuf[(s*percol)+v]; int newpos = ((l+0x80) * (LINES - 4)) / 0xFF;
} horzInc = (newpos < midLine)?-1:1;
int l = lerp(bufbuf[s], (colsum / percol)*2, 0.8f); for (int j = midLine; j != newpos; j+=horzInc) {
if (l >= 0x80) l = 0x80; wmove(dis, j, (int)nxcol);
else if (l <= -0x80) l = -0x80; waddch(dis, '|');
int r = (1.0*(l+0x80)/0xFF)*(LINES-4); }
wmove(dis, newpos, (int)nxcol);
for (int j = l; j != bufbuf[s]; j+=(bufbuf[s]>l?1:-1)) { waddch(dis, '|');
wmove(dis, (1.0*(j+0x80)/0xFF)*(LINES-4), s); nxcol+=(1.0*(COLS-2)/fi->buffer_size);
waddch(dis, '|'); bufbuf[s] = l;
} }
wmove(dis, r, s);
waddch(dis, '+');
bufbuf[s] = l;
}
} }
void displayNoteRoll(xmp_module_info *mi, xmp_frame_info *fi) { void displayNoteRoll(xmp_module_info *mi, xmp_frame_info *fi) {
@ -977,7 +973,7 @@ void addToEffects(int id, char efx, bool mem) {
efxmemtable[id] = mem; efxmemtable[id] = mem;
} }
bool isPartOf(char* w1, const char* w2) { bool isPartOf(char* w1, char* w2) {
int i=0; int i=0;
int j=0; int j=0;
while(w1[i]!='\0'){ while(w1[i]!='\0'){

View File

@ -18,6 +18,6 @@ void displayPlayer();
void displayHelp(); void displayHelp();
void generateEffectsTable(char* type); void generateEffectsTable(char* type);
void addToEffects(int id, char efx, bool mem); void addToEffects(int id, char efx, bool mem);
bool isPartOf(char* w1, const char* w2); bool isPartOf(char* w1, char* w2);
#endif #endif