Skip to content

Commit eb2a3d0

Browse files
committedNov 20, 2015
Reverting errant merge commit.
1 parent 29a5613 commit eb2a3d0

17 files changed

+467
-556
lines changed
 

‎AudioLogic.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const int bandCount = 7;
4242
// the 10Bit (0-1023) audio band values
4343
int levels[bandCount];
4444
int peaks[bandCount];
45-
static const int defaultPeakDecay = (1024 / MATRIX_HEIGHT) / 2;
45+
static const int defaultPeakDecay = (1024 / MATRIX_HEIGHT) / 4;
4646
int peakDecay = defaultPeakDecay;
4747
bool drawPeaks = true;
4848

‎AudioPatterns.h

+130-130
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class AudioPatterns : public Playlist {
4444

4545
AudioPatternFunctionPointer currentItem;
4646

47-
static const int PATTERN_COUNT = 33;
47+
static const int PATTERN_COUNT = 39;
4848

4949
AudioPatternFunctionPointer shuffledItems[PATTERN_COUNT];
5050

@@ -55,16 +55,16 @@ class AudioPatterns : public Playlist {
5555
&AudioPatterns::radar,
5656
&AudioPatterns::gauge,
5757
&AudioPatterns::gauge2,
58-
// &AudioPatterns::paletteSmear,
59-
// &AudioPatterns::bounce,
58+
&AudioPatterns::paletteSmear,
59+
&AudioPatterns::bounce,
6060
&AudioPatterns::incrementalDrift,
6161
&AudioPatterns::incrementalDrift2,
6262
&AudioPatterns::pendulumWave,
6363
&AudioPatterns::fire,
64-
// &AudioPatterns::analyzerPixelsWithNoiseSmearing,
65-
// &AudioPatterns::analyzerColumnsWithNoiseSmearing,
66-
// &AudioPatterns::randomEmittersWithNoiseSmearing,
67-
// &AudioPatterns::lineChartWithNoiseSmearing,
64+
&AudioPatterns::analyzerPixelsWithNoiseSmearing,
65+
&AudioPatterns::analyzerColumnsWithNoiseSmearing,
66+
&AudioPatterns::randomEmittersWithNoiseSmearing,
67+
&AudioPatterns::lineChartWithNoiseSmearing,
6868
&AudioPatterns::analyzerPixelsWithOneLargeSpiral,
6969
&AudioPatterns::analyzerPixelsWithFiveSpirals,
7070
&AudioPatterns::analyzerPixelsWithStreamDown120,
@@ -196,15 +196,15 @@ class AudioPatterns : public Playlist {
196196
drawAnalyzerPixels();
197197
}
198198

199-
// void analyzerPixelsWithNoiseSmearing() {
200-
// effects.DimAll(235);
201-
//
202-
// drawAnalyzerPixels();
203-
//
204-
// effects.standardNoiseSmearing();
205-
//
206-
// peakDecay = 32;
207-
// }
199+
void analyzerPixelsWithNoiseSmearing() {
200+
effects.DimAll(235);
201+
202+
drawAnalyzerPixels();
203+
204+
effects.standardNoiseSmearing();
205+
206+
peakDecay = 32;
207+
}
208208

209209
void drawAnalyzerPixels() {
210210
for (int x = 0; x < MATRIX_WIDTH; x++) {
@@ -240,15 +240,15 @@ class AudioPatterns : public Playlist {
240240
analyzerLinesByIntensity();
241241
}
242242

243-
// void lineChartWithNoiseSmearing() {
244-
// effects.DimAll(235);
245-
//
246-
// analyzerLinesByIntensity();
247-
//
248-
// effects.standardNoiseSmearing();
249-
//
250-
// peakDecay = 32;
251-
// }
243+
void lineChartWithNoiseSmearing() {
244+
effects.DimAll(235);
245+
246+
analyzerLinesByIntensity();
247+
248+
effects.standardNoiseSmearing();
249+
250+
peakDecay = 32;
251+
}
252252

253253
void lineChartWithSpiral() {
254254
effects.SpiralStream(MATRIX_CENTRE_X, MATRIX_CENTRE_Y, MATRIX_WIDTH / 2, 120);
@@ -274,15 +274,15 @@ class AudioPatterns : public Playlist {
274274
analyzerColumnsByIntensity();
275275
}
276276

277-
// void analyzerColumnsWithNoiseSmearing() {
278-
// effects.DimAll(235);
279-
//
280-
// analyzerColumnsByIntensity();
281-
//
282-
// effects.standardNoiseSmearing();
283-
//
284-
// peakDecay = 32;
285-
// }
277+
void analyzerColumnsWithNoiseSmearing() {
278+
effects.DimAll(235);
279+
280+
analyzerColumnsByIntensity();
281+
282+
effects.standardNoiseSmearing();
283+
284+
peakDecay = 32;
285+
}
286286

287287
void analyzerColumnsWithOneLargeSpiralStream() {
288288
effects.SpiralStream(MATRIX_CENTRE_X, MATRIX_CENTRE_Y, MATRIX_WIDTH / 2, 120);
@@ -456,15 +456,15 @@ class AudioPatterns : public Playlist {
456456
drawRandomEmitters();
457457
}
458458

459-
// void randomEmittersWithNoiseSmearing() {
460-
// effects.DimAll(235);
461-
//
462-
// drawRandomEmitters();
463-
//
464-
// effects.standardNoiseSmearing();
465-
//
466-
// peakDecay = 32;
467-
// }
459+
void randomEmittersWithNoiseSmearing() {
460+
effects.DimAll(235);
461+
462+
drawRandomEmitters();
463+
464+
effects.standardNoiseSmearing();
465+
466+
peakDecay = 32;
467+
}
468468

469469
void drawRandomEmitters() {
470470
for (int i = 0; i < bandCount; i++) {
@@ -648,27 +648,27 @@ class AudioPatterns : public Playlist {
648648

649649
// calculate noise matrix
650650
// x and y define the lower left point
651-
// void FillNoise() {
652-
// for (int i = 0; i < MATRIX_WIDTH; i++) {
653-
// int ioffset = scale * i;
654-
// for (int j = 0; j < MATRIX_HEIGHT; j++) {
655-
// int joffset = scale * j;
656-
// noise[i][j] = inoise8(x + ioffset, y + joffset, z);
657-
// }
658-
// }
659-
// }
651+
void FillNoise() {
652+
for (int i = 0; i < MATRIX_WIDTH; i++) {
653+
int ioffset = scale * i;
654+
for (int j = 0; j < MATRIX_HEIGHT; j++) {
655+
int joffset = scale * j;
656+
noise[i][j] = inoise8(x + ioffset, y + joffset, z);
657+
}
658+
}
659+
}
660660

661661
// calculate noise matrix
662662
// x and y define the center
663-
// void FillNoiseCentral() {
664-
// for (int i = 0; i < MATRIX_WIDTH; i++) {
665-
// int ioffset = scale * (i - 8);
666-
// for (int j = 0; j < MATRIX_HEIGHT; j++) {
667-
// int joffset = scale * (j - 8);
668-
// noise[i][j] = inoise8(x + ioffset, y + joffset, z);
669-
// }
670-
// }
671-
// }
663+
void FillNoiseCentral() {
664+
for (int i = 0; i < MATRIX_WIDTH; i++) {
665+
int ioffset = scale * (i - 8);
666+
for (int j = 0; j < MATRIX_HEIGHT; j++) {
667+
int joffset = scale * (j - 8);
668+
noise[i][j] = inoise8(x + ioffset, y + joffset, z);
669+
}
670+
}
671+
}
672672

673673
int band5 = (int) ((float) bandCount * 0.75);
674674

@@ -984,75 +984,75 @@ class AudioPatterns : public Playlist {
984984
}
985985
}
986986

987-
// PVector gravity = PVector(0, 0.0250);
988-
// PVector impulse = PVector(0, 0);
989-
// boolean startedAttractor = false;
990-
// void bounce() {
991-
// const int count = 32;
992-
//
993-
// if (!startedAttractor) {
994-
// startedAttractor = true;
995-
//
996-
// int direction = random(0, 2);
997-
// if (direction == 0)
998-
// direction = -1;
999-
//
1000-
// for (int i = 0; i < count; i++) {
1001-
// Boid boid = Boid(i, MATRIX_HEIGHT - 1);
1002-
// boid.velocity.x = 0;
1003-
// boid.velocity.y = 0;
1004-
// boid.maxforce = 10;
1005-
// boid.maxspeed = 10;
1006-
// boids[i] = boid;
1007-
// }
1008-
// }
1009-
//
1010-
// // dim all pixels on the display
1011-
// effects.DimAll(170);
1012-
//
1013-
// for (int i = 0; i < count; i++) {
1014-
// Boid boid = boids[i];
1015-
// boid.velocity.x = 0;
1016-
// boid.location.x = i;
1017-
// boid.applyForce(gravity);
1018-
//
1019-
// uint8_t bandIndex = i / 5;
1020-
//
1021-
// int level = levels[bandIndex];
1022-
// if (drawPeaks)
1023-
// level = peaks[bandIndex];
1024-
//
1025-
// if (boid.location.y == MATRIX_HEIGHT - 1) {
1026-
// impulse.y = - (float)random(level * .75, level) / 960.0F;
1027-
// boid.applyForce(impulse);
1028-
// }
1029-
//
1030-
// boid.update();
1031-
//
1032-
// boid.bounceOffBorders(0.2);
1033-
//
1034-
// boids[i] = boid;
1035-
//
1036-
// backgroundLayer.drawPixel(boid.location.x, boid.location.y, effects.ColorFromCurrentPalette(((MATRIX_HEIGHT - 1) - boid.location.y) * 7));
1037-
// }
1038-
// }
1039-
1040-
// void paletteSmear() {
1041-
// effects.DimAll(170);
1042-
//
1043-
// // draw a rainbow color palette
1044-
// for (uint8_t y = 0; y < MATRIX_HEIGHT; y++) {
1045-
// for (uint8_t x = 0; x < MATRIX_WIDTH; x++) {
1046-
// int level = interpolatedLevels[x / horizontalPixelsPerBand];
1047-
//
1048-
// effects.leds[XY(x, y)] += effects.ColorFromCurrentPalette(level / 5, y * (256 / MATRIX_HEIGHT));
1049-
// }
1050-
// }
1051-
//
1052-
// effects.standardNoiseSmearing();
1053-
//
1054-
// peakDecay = 32;
1055-
// }
987+
PVector gravity = PVector(0, 0.0250);
988+
PVector impulse = PVector(0, 0);
989+
boolean startedAttractor = false;
990+
void bounce() {
991+
const int count = 32;
992+
993+
if (!startedAttractor) {
994+
startedAttractor = true;
995+
996+
int direction = random(0, 2);
997+
if (direction == 0)
998+
direction = -1;
999+
1000+
for (int i = 0; i < count; i++) {
1001+
Boid boid = Boid(i, MATRIX_HEIGHT - 1);
1002+
boid.velocity.x = 0;
1003+
boid.velocity.y = 0;
1004+
boid.maxforce = 10;
1005+
boid.maxspeed = 10;
1006+
boids[i] = boid;
1007+
}
1008+
}
1009+
1010+
// dim all pixels on the display
1011+
effects.DimAll(170);
1012+
1013+
for (int i = 0; i < count; i++) {
1014+
Boid boid = boids[i];
1015+
boid.velocity.x = 0;
1016+
boid.location.x = i;
1017+
boid.applyForce(gravity);
1018+
1019+
uint8_t bandIndex = i / 5;
1020+
1021+
int level = levels[bandIndex];
1022+
if (drawPeaks)
1023+
level = peaks[bandIndex];
1024+
1025+
if (boid.location.y == MATRIX_HEIGHT - 1) {
1026+
impulse.y = - (float)random(level * .75, level) / 960.0F;
1027+
boid.applyForce(impulse);
1028+
}
1029+
1030+
boid.update();
1031+
1032+
boid.bounceOffBorders(0.2);
1033+
1034+
boids[i] = boid;
1035+
1036+
backgroundLayer.drawPixel(boid.location.x, boid.location.y, effects.ColorFromCurrentPalette(((MATRIX_HEIGHT - 1) - boid.location.y) * 7));
1037+
}
1038+
}
1039+
1040+
void paletteSmear() {
1041+
effects.DimAll(170);
1042+
1043+
// draw a rainbow color palette
1044+
for (uint8_t y = 0; y < MATRIX_HEIGHT; y++) {
1045+
for (uint8_t x = 0; x < MATRIX_WIDTH; x++) {
1046+
int level = interpolatedLevels[x / horizontalPixelsPerBand];
1047+
1048+
effects.leds[XY(x, y)] += effects.ColorFromCurrentPalette(level / 5, y * (256 / MATRIX_HEIGHT));
1049+
}
1050+
}
1051+
1052+
effects.standardNoiseSmearing();
1053+
1054+
peakDecay = 32;
1055+
}
10561056

10571057
void gauge() {
10581058
blur2d( effects.leds, MATRIX_WIDTH, MATRIX_HEIGHT, 10);

‎Aurora.ino

+7-8
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
#include <SmartMatrix3.h>
2828

2929
#define COLOR_DEPTH 24 // known working: 24, 48 - If the sketch uses type `rgb24` directly, COLOR_DEPTH must be 24
30-
const uint8_t kMatrixWidth = 64; // known working: 32, 64, 96, 128
31-
const uint8_t kMatrixHeight = 64; // known working: 16, 32, 48, 64
32-
const uint8_t kRefreshDepth = 24; // known working: 24, 36, 48
33-
const uint8_t kDmaBufferRows = 2; // known working: 2-4, use 2 to save memory, more to keep from dropping frames and automatically lowering refresh rate
34-
const uint8_t kPanelType = SMARTMATRIX_HUB75_32ROW_MOD16SCAN; // SMARTMATRIX_HUB75_16ROW_MOD8SCAN or SMARTMATRIX_HUB75_32ROW_MOD16SCAN
30+
const uint8_t kMatrixWidth = 32; // known working: 32, 64, 96, 128
31+
const uint8_t kMatrixHeight = 32; // known working: 16, 32, 48, 64
32+
const uint8_t kRefreshDepth = 36; // known working: 24, 36, 48
33+
const uint8_t kDmaBufferRows = 4; // known working: 2-4, use 2 to save memory, more to keep from dropping frames and automatically lowering refresh rate
34+
const uint8_t kPanelType = SMARTMATRIX_HUB75_32ROW_MOD16SCAN; // use SMARTMATRIX_HUB75_16ROW_MOD8SCAN for common 16x32 panels
3535
const uint8_t kMatrixOptions = (SMARTMATRIX_OPTIONS_NONE); // see http://docs.pixelmatix.com/SmartMatrix for options
3636
const uint8_t kBackgroundLayerOptions = (SM_BACKGROUND_OPTIONS_NONE);
3737
const uint8_t kScrollingLayerOptions = (SM_SCROLLING_OPTIONS_NONE);
@@ -166,8 +166,8 @@ rgb24 menuColor = CRGB(CRGB::Blue);
166166
int menuY = MATRIX_HEIGHT / 2 - 4;
167167
int autoPlayDurationSeconds = 10;
168168

169-
//#include "StreamingMode.h"
170-
//StreamingMode streamingMode;
169+
#include "StreamingMode.h"
170+
StreamingMode streamingMode;
171171

172172
#include "MenuItem.h"
173173
#include "Menu.h"
@@ -249,7 +249,6 @@ void setup()
249249

250250
matrix.setRotation(rotation);
251251
matrix.setBrightness(brightness);
252-
matrix.setRefreshRate(120);
253252

254253
scrollingLayer.enableColorCorrection(true);
255254
scrollingLayer.setFont(gohufont11b);

‎Boid.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -322,5 +322,5 @@ class Boid {
322322
}
323323
};
324324

325-
static const uint8_t AVAILABLE_BOID_COUNT = 20;
325+
static const uint8_t AVAILABLE_BOID_COUNT = 40;
326326
Boid boids[AVAILABLE_BOID_COUNT];

0 commit comments

Comments
 (0)
Please sign in to comment.