musiclight2/config.h

54 lines
1.4 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* vim: sw=2 ts=2 expandtab
*
* "THE PIZZA-WARE LICENSE" (derived from "THE BEER-WARE LICENCE"):
* Thomas Kolb <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.42.1"
#define PORT 2703
// FFT transformation parameters
#define FFT_EXPONENT 8 // ATTENTION: when you change this, run gen_lut.py with this value as argument
#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)
// Must be a little faster than the hardware update rate to ensure theres
// always a packet in the queue
//#define LED_INTERVAL 0.01
#define LED_INTERVAL (1.0/61.0)
// 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;
typedef double value_type;
#endif // CONFIG_H