ReMAS  1.5
Real-time Musical Accompaniment System
Data Structures | Macros | Typedefs
defines.h File Reference

General header file with constants, defines, structs, etc. using by ReMAS, both CPU and GPU. More...

Go to the source code of this file.

Data Structures

struct  DTWconst
 Struct for store global information of the problem.
Each composition needs a file with values for these parameters. The structure of this text file, shared with DTWfiles struct should be one line per parameter. No empty lines and one empty line to the end. Example of this file:
57 // Number of bases/combinations.
77 // Number of states.
0.15 // Note duration (sec.) in the score.
11.5129 // ALPHA value.
Datos/30sec/Input/hanning.bin // Name and path to the file with hanning data.
...
Datos/30sec/Input/corrstates.bin // Name and path to the file with corr_states data.
1 // If 0 input audio from WAV file. If 1 input audio from sound device.
hw:2,0 // Sound devide (mic) identification. If previous parameter=0 not used.
150 // MIDI time. Not used when ...
5 // Number of OSC clients. Limited to constant MaxOSC.
127.0.0.1 // If number of OSC client >0 the Host IP for the 1st client.
5432 // If number of OSC client >0 the Port for the 1st client.
...
127.0.0.5 // If number of OSC client >0 the Host IP for the last client.
5445 // If number of OSC client >0 the Port for the last client.
More...
 
struct  DTWfiles
 Struct for store the name of input/verificaton files.
Each composition needs a file with values for these parameters. The structure of this text file, shared with DTWconst struct should be one line per parameter. No empty lines and one empty line to the end. Example of this file:
57 // Number of bases/combinations.
77 // Number of states.
0.15 // Note duration (sec.) in the score.
11.5129 // ALPHA value.
Datos/30sec/Input/hanning.bin // Name and path to the file with hanning data.
...
Datos/30sec/Input/corrstates.bin // Name and path to the file with corr_states data.
1 // If 0 input audio from WAV file. If 1 input audio from sound device.
hw:2,0 // Sound devide (mic) identification. If previous parameter=0 not used.
150 // MIDI time. Not used when ...
5 // Number of OSC clients. Limited to constant MaxOSC.
127.0.0.1 // If number of OSC client >0 the Host IP for the 1st client.
5432 // If number of OSC client >0 the Port for the 1st client.
...
127.0.0.5 // If number of OSC client >0 the Host IP for the last client.
5445 // If number of OSC client >0 the Port for the last client.
More...
 
struct  WAVHeader
 Struct for WAVE file header.
WAV files definitions. Note that we only work with 1 channel, 2 bytes per sample FMT length 16, PCM format, standard header length (44 bytes). See Read_WAVHeader function within FileFunctions.c file and struct WAVHeader within this file. More...
 
struct  STempo
 Struct for Compute tempos.
More...
 
struct  STempoRL
 Struct for Compute tempos.
More...
 

Macros

#define DATA_H
 
#define N_MIDI   114 /* For now, N_MIDI = 114 */
 
#define N_MIDI_PAD   128 /* Para que esté alineado */
 
#define N_FFT   16384 /* For now, N_FFT = 16384 */
 
#define TAMTRAMA   5700 /* For now, TAMTRAMA = 10*TAMMUESTRA */
 
#define TAMMUESTRA   570 /* For now, TAMMUESTRA = 570 */
 
#define TTminusTM   (TAMTRAMA-TAMMUESTRA)
 
#define N_COSTS   4 /* For now 2 dimensins and 4 costs per dimension */
 
#define T_COSTS   (2*N_COSTS-1) /* Thereby total number of costs used is this value */
 
#define TBLOCK   (N_COSTS+1) /* another used derivate value */
 
#define Scaling   0.000030517578125 /* This is 1/32768, scaling factor for conversion */
 
#define sizeWarp   32
 
#define maxThreads   512
 
#define maxBlocks   256
 
#define MyType   double
 
#define MyFFTCPUType   fftw_plan
 
#define MyFFTGPUType   cufftHandle
 
#define WAVHeaderLength   44
 
#define MaxOSC   5 /* Maximum number of OSC clients supported */
 
#define RunJumpTime   0.012925 /* 0.012925=(TAMMUESTRA / {AlsaRate or AQRate}), seconds */
 
#define TrainJumpTime   0.012925 /* This depends on traning, seconds */
 
#define DelayTimeMidi   1 /* Delay midi time for matching */
 
#define NUMAPMAX   12 /* Number of anchor points for tempo estimation */
 
#define NUMAPPAIRS   (NUMAPMAX*(NUMAPMAX-1)/2) /* Number of AP pairs for tempo estimation */
 
#define HMMchange   0.20 /* change state probability */
 
#define HMMremain   0.80 /* 1-HMMchange */
 
#define OK   0
 
#define ErrReadFile   -1
 
#define ErrWriteFile   -2
 
#define ErrInfoReaded   -3
 
#define ErrGpuWrong   -4
 
#define ErrFFTSched   -5
 
#define ErrReadDevice   -6
 
#define ErrSendOSC   -7
 
#define ErrAlsaHw   -8
 
#define ErrWavFormat   -9
 
#define ErrNULL   -10;
 
#define ErrTimer   -11;
 
#define CHECKERR(x)
 
#define CHECKNULL(x)
 
#define CUDAERR(x)
 
#define CUBLASERR(x)
 
#define CUFFTERR(x)
 
#define min(x, y)   ((x < y) ? x : y)
 

Typedefs

typedef struct DTWconst DTWconst
 
typedef struct DTWfiles DTWfiles
 
typedef struct WAVHeader WAVHeader
 
typedef struct STempo STempo
 
typedef struct STempoRL STempoRL
 

Detailed Description

General header file with constants, defines, structs, etc. using by ReMAS, both CPU and GPU.

Author
Information Retrieval and Parallel Computing Group, University of Oviedo, Spain
Interdisciplinary Computation and Communication Group, Universitat Politecnica de Valencia, Spain
Signal Processing and Telecommunication Systems Research Group, University of Jaen, Spain.
Contact: remas.nosp@m.pack.nosp@m.@gmai.nosp@m.l.co.nosp@m.m
Date
February 13, 2017

Definition in file defines.h.

Macro Definition Documentation

◆ CHECKERR

#define CHECKERR (   x)
Value:
do { if((x)<0) { \
printf("Error %d calling %s line %d\n", x, __FILE__, __LINE__);\
return x;}} while(0)

Definition at line 119 of file defines.h.

◆ CHECKNULL

#define CHECKNULL (   x)
Value:
do { if((x)==NULL) { \
printf("NULL (when open file or memory allocation calling %s line %d\n", __FILE__, __LINE__);\
return ErrNULL;}} while(0)

Definition at line 123 of file defines.h.

◆ CUBLASERR

#define CUBLASERR (   x)
Value:
do { if((x)!=CUBLAS_STATUS_SUCCESS) { \
printf("CUBLAS error: %s, line %d\n", __FILE__, __LINE__);\
return EXIT_FAILURE;}} while(0)

Definition at line 131 of file defines.h.

◆ CUDAERR

#define CUDAERR (   x)
Value:
do { if((x)!=cudaSuccess) { \
printf("CUDA error: %s : %s, line %d\n", cudaGetErrorString(x), __FILE__, __LINE__);\
return EXIT_FAILURE;}} while(0)

Definition at line 127 of file defines.h.

◆ CUFFTERR

#define CUFFTERR (   x)
Value:
do { if((x)!=CUFFT_SUCCESS) { \
printf("CUFFT error: %s, line %d\n", __FILE__, __LINE__);\
return EXIT_FAILURE;}} while(0)

Definition at line 135 of file defines.h.