2012-07-13 21:18:35 +02:00
|
|
|
/*
|
|
|
|
* vim: sw=2 ts=2 expandtab
|
|
|
|
*
|
|
|
|
* THE PIZZA-WARE LICENSE" (derived from "THE BEER-WARE LICENCE"):
|
|
|
|
* <cfr34k@tkolb.de> wrote this file. As long as you retain this notice you can
|
|
|
|
* do whatever you want with this stuff. If we meet some day, and you think
|
|
|
|
* this stuff is worth it, you can buy me a pizza in return. - Thomas Kolb
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef CONFIG_H
|
|
|
|
#define CONFIG_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
// configuration variables for musiclight2
|
|
|
|
|
|
|
|
// networking
|
|
|
|
#define HOST "192.168.23.222"
|
|
|
|
#define PORT 2703
|
|
|
|
|
|
|
|
// FFT transformation parameters
|
2012-09-03 18:50:11 +02:00
|
|
|
#define FFT_EXPONENT 10 // ATTENTION: when you change this, run gen_lut.py with this value as argument
|
2012-07-13 21:18:35 +02:00
|
|
|
#define BLOCK_LEN (1 << FFT_EXPONENT) // 2^FFT_EXPONENT
|
|
|
|
#define SAMPLE_RATE 44100
|
|
|
|
#define DATALEN (BLOCK_LEN / 2)
|
|
|
|
|
|
|
|
// Number of parts in the sample buffer
|
|
|
|
#define BUFFER_PARTS 2
|
|
|
|
|
|
|
|
// update rate for the led strip (in seconds)
|
|
|
|
#define LED_INTERVAL 0.03
|
|
|
|
|
|
|
|
// frequency ranges for the base colors
|
|
|
|
#define RED_MIN_FREQ 0
|
|
|
|
#define RED_MAX_FREQ 400
|
|
|
|
#define GREEN_MIN_FREQ 400
|
|
|
|
#define GREEN_MAX_FREQ 4000
|
|
|
|
#define BLUE_MIN_FREQ 4000
|
|
|
|
#define BLUE_MAX_FREQ SAMPLE_RATE/2
|
|
|
|
|
|
|
|
#define COLOR_MAX_REDUCTION_FACTOR 0.9998
|
|
|
|
|
|
|
|
// sample data types
|
|
|
|
typedef int16_t sample;
|
|
|
|
typedef int64_t sample_sum;
|
|
|
|
|
2012-09-03 17:16:14 +02:00
|
|
|
typedef double value_type;
|
|
|
|
|
2012-07-13 21:18:35 +02:00
|
|
|
#endif // CONFIG_H
|