Coder Social home page Coder Social logo

colorchord's Introduction

ColorChord

Table of Contents

What is ColorChord?

Chromatic Sound to Light Conversion System. It's really that simple. Unlike so many of the sound responsive systems out there, ColorChord looks at the chromatic properties of the sound. It looks for notes, not ranges. If it hears an "E" it doesn't care what octave it's in, it's an E. This provides a good deal more interesting patterns between instruments and music than would be available otherwise.

Background Video here:

What Is ColorChord?

ColorChord on an ESP8266:

Websockets for Awesome on an ESP8266

More videos below!

Background

Developed over many years, ColorChord 2 is now at the alpha stages. ColorChord 2 uses the same principles as ColorChord 1. A brief writeup on that can be seen here: http://cnlohr.blogspot.com/2010/11/colorchord-sound-lighting.html

The major differences in ColorChord 2 is the major rewrite to move everything back to the CPU and a multitude of algorithmic optimizations to make it possible to run on something other than the brand newest of systems.

Feuge in D Minor (ColorChord 2 running a strip of WS2812 LEDs):

ColorChord

ColorChord 2 running a voronoi diagram with Mayhem's Dr. Rocker

ColorChord 2 Preview: Dr Rocker by Mayhem

Current State of Affairs

Currently, ColorChord 2 is designed to run on Linux or Windows. It's not particularly tied to an architecture, but does pretty much need a dedicated FPU to achieve any decent performance. Right now there aren't very many output options available for it. The most interesting one used for debugging is a voronoi-diagram-like thing called "DisplayShapeDriver."

ColorChord: Embedded

There is work on an embedded version of ColorChord, which avoids floating point operations anywhere in the output pipeline. Though I have made efforts to port it to AVRs, it doesn't seem feasable to operate on AVRs without some shifty tricks which I'd like to avoid, so I have retargeted my efforts to 32-bit systems, such as the STM32F303, STM32F407, and (somehow) the ESP8266. ColorChord Embedded uses a different codebase, located in the embeddedcommon and distributed among the various embedded* folders.

Build Instructions

Building ColorChord Embedded

The embedded version of Colorchord has a different build system than the desktop versions of Colorchord. See the build instructions for each of the supported embedded architectures in their respective folders

Building with Linux

From the linux terminal use apt-get to install the following packages for Debian/Ubuntu/Mint:

apt-get install build-essential libpulse-dev libasound2-dev libx11-dev libxext-dev libxinerama-dev libusb-1.0-0-dev libudev-dev

To get colorchord, type:

git clone --recurse-submodules https://github.com/cnlohr/colorchord

This will download the colorchord source code into the colorchord directory

You really want to be using colorchord2, so we need to move to it's build directory to compile the source code.

cd colorchord/colorchord2

To make colorchord, type:

make

Building with Windows

There are 3 options available for building on Windows, clang, or TCC, MSYS2.

clang

Start by downloading the clang compiler, and installing it. You can also install using winget using the following command in PowerShell

winget install -e --id LLVM.LLVM

If you have the Windows SDK installed, you should not need to do any additional work.
If you do not, you'll want to either install it to get the official headers. Realistically, it's easyist to get the headers by installing Visual Studio Communitiy and selecting the C/C++ Desktop Application devlopment package and installing it from there Visual Studio.

Once the Windows headers are installed run the clang batch script, and it should output to colorchord2/colorchord.exe.

./compile-clang.bat

TCC

Start by downloading TCC, and extracting it to C:\tcc. You can put it anywhere you like, but the compile script defaults to this location. If you install to the default location, you can skip the next step.

Edit the batch script at colorchord2/windows/compile.bat:

  • Edit line 17 (CC) to be the location where you put TCC. If there are spaces in the path, wrap the entire path in quotes.

Note that TCC is not able to use the Windows SDK, and as such using the unofficial headers is required, and automatically enabled when compiling with TCC. If you encounter issues, try the clang method above instead. TCC does not support open-gl rendering and is limited to software rendering.

MSYS2

With either 64bit or 32bit MSYS2 installed, run the MSYS2 MSYS launcher and use pacman to set up a MinGW32 toolchain, if you don't have one already:

pacman -S mingw-w64-i686-toolchain

If you see "/mingw32 exists in filesystem", you must temporarily rename or relocate the mingw32.exe file at MSYS2's root folder level and try again. Restore mingw32.exe before moving on.

Next, run the MSYS2 MinGW 32bit launcher to access the toolchain. The previously launched MSYS terminal can be closed.

To make colorchord, navigate to your working copy and type:

mingw32-make colorchord.exe

Using

To run colorchord, use the following syntax:

./colorchord [config file, by default 'default.conf'] [any additional parameters]

If you edit default.conf while the program is running and resave it, it will use the settings in the newly saved file.

Note that the colorchord executable file is located in the colorchord2 directory in the colorchord repository.

Additional Videos

Come Thou Fount of Every Blessing

ColorChord 2 - David Chapman Plays Sax

colorchord's People

Contributors

alarixnia avatar angyongen avatar bbkiwi avatar caib avatar clemrz avatar cmchick avatar cnlohr avatar con-f-use avatar connornishijima avatar eugene8388608 avatar hazcoper avatar heme2 avatar jinodk avatar kant avatar nikkyai avatar opus506 avatar sellicott avatar solarkraft avatar timgates42 avatar wesleygas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

colorchord's Issues

Websocket commands and expected responses

I've been trying to port the websockets based web UI to the arduino port of esp8266. I got the basic connection going at ~150Hz (Not as great as your implementation with C). Any chance you have the custom commands and expected responses documented somewhere? Even simple pointers would make it a lot faster than reverse engineering the whole thing from source code.

e.g. Commands like CVR, I'm not sure whats the exact intent.

Thanks for making such an awesome thing!

USB Audio Input on Raspberry Pi Zero W

Hi,
I'm attempting to run Colorchord2 on a headless Raspberry Pi Zero Wireless. I'm using a USB PnP Mic and no audio output; my goal is to use the audio input from the mic to control a short string of NeoPixels. The goal is that the Pi will boot with a read-only disk and begin controlling the NeoPixels until someone unplugs the power. The mic is the only input device, the NeoPixels the only output device.

Unfortunately I seem to be getting an error related to the audio input as shown below.

Output is as follows:

pi@MIC-4FQ4:~ $ sudo colorchord /home/pi/colorchord-master/colorchord2/default.conf
Output Drivers:
	OutputCells
	DisplayHIDAPI
	RecorderPlugin
	OutputProminent
	DisplayDMX
	DisplayUSB2812
	DisplayNetwork
	DisplayPie
	OutputLinear
	DisplayArray
	OutputVoronoi
	null
   Warning: cannot open default.conf.
   LF: /home/pi/colorchord-master/colorchord2/default.conf
   Set: headless 1
   Set: cpu_autolimit 1
   Set: set_screenx 720
   Set: set_screeny 480
   Set: sound_source ALSA
   Set: sample_channel -1
   Loading: OutputVoronoi
   Found: OutputVoronoi 0x1739c
   Loading: DisplayArray
   Found: DisplayArray 0x17248
   Initializing sound.  Recommended driver: ALSA
   U: record = 1
   U: devrecord = default
   cannot open input audio device (No such file or directory)
   ERROR: Failed to initialize sound output device

lsusb gives me the following:

pi@MIC-4FQ4:~ $ lsusb
Bus 001 Device 003: ID 08bb:2902 Texas Instruments PCM2902 Audio Codec
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Alsamixer sees the USB mic as a " USB PnP Sound Device" and an id of hd:1.

What am I doing wrong?

Thanks,
Ian

Arduino Nodemcu ESP8266

Is there a way to implement this in an arduino Nodemcu/D1mini ESP8266 that doesn't need a PC to crunch the audio input from an electret mic?

Cannot connect to wifi router in station mode

Hi to all. is here somebody with similar problem?
When I try to set up the ESP module via web-GUI to station mode (I set the SSID, pasword and click the "change parameters" button)
the ESP writes on uart:

Switching to: "SSID"/"Pasword" (12/12). BSSID_SET: 0 [1]
-->'SSID'
-->'Pasword'
Switching.

ets Jan 8 2013,rst cause:2, boot mode:(1,6)

ets Jan 8 2013,rst cause:4, boot mode:(1,6)

wdt reset

after that, my ESP stoned.
After that I have done restart. The ESP then writes on uart by endless loop this:

don't use rtc mem data
rl๏ฟฝ
ColorChord
Opmode: 1
Station mode: "SSID":"Pasword" (bssid_set:0)

ets Jan 8 2013,rst cause:2, boot mode:(3,6)

load 0x40100000, len 32660, room 16
tail 4
chksum 0xa5
load 0x3ffe8000, len 1076, room 4
tail 0
chksum 0xd6
load 0x3ffe8440, len 3272, room 8
tail 0
chksum 0x7d
csum 0x7d

Have You any advice?

My HW: ESP-07

Yellow is not quite yellow

I was playing Yellow Submarine on my colorchord and was SORELY disappointed when the yellow was more... green/blue than yellow when they said yellow. I will say though, I was glad that "Sky of blue" was indeed blue, but "sea of green" was quite light blue for a green.

2/5 might chord again

https://youtu.be/gr1Bc0g0jQ0

Serial Output to Arduino

i dont know much about coding but i am wondering if it can output to a serial so an arduino could receive and change colors to a RGB strip!

page not found

built the project with the provide make file , everything seemed to be fine. Burned the firmware with the following....

esptool.py --port /dev/tty.SLAB_USBtoUART write_flash 0 image.elf-0x00000.bin 0x40000 image.elf-0x40000.bin

Connected to the esp but get a page not found when accessing 192.168.4.1... any suggestions?

No Audio on Windows

Hey Charles,

I'm trying to get this working on Windows, and am having a really hard time. This is on my laptop, which as a microphone, and I also tried installing Virtual Audio Cable to capture output as another input device. I can see in the settings that both devices are receiving sound, but ColorChord seems to be getting no signal.

I tried wininput values of -1 through 8. Here is the output when I try -1:

Output Drivers:
        DisplayNetwork
        DisplayArray
        DisplayHIDAPI
        DisplayOutDriver
        DisplayPie
        null
        OutputCells
        OutputLinear
        OutputProminent
        OutputVoronoi
Set: cpu_autolimit 1
Set: set_screenx 720
Set: set_screeny 480
Set: sample_channel -1
Loading: OutputVoronoi
Found: OutputVoronoi 0000000000410022
Loading: DisplayArray
Found: DisplayArray 0000000000405FD0
Initializing sound.  Recommended driver: WIN
Buffer: 384
WFMT Size (debugging temp for TCC): 18
WFMT: 2 44100 88200
Wave Devs: 2; WAVE_MAPPER: -1; Selected Input: -1
waveInOpen: 0000000002753BF8, 000000000014ED1A
Mic Open.
WIO: 0
WIS: 0
24 5 55.000000 20.000000 2.000000

Devices -1, 0, and 1 cause WIO and WIS to output 0. Other devices cause an output of 2, 5 respectively (I assume this means it couldn't open that device, since those don't exist).

ColorChord sadly just sits there, with a black screen, and all 0s.

I was able to get it working on Ubuntu fine, but would rather avoid using that as it doesn't fit into my intended application.

Do you have any suggestions as to what I could try in order to get it working?

Thanks!

More than one octave

I'd like to modify colorchord to cover more than 1 octave. As I understand it, it repeats itself for each octave right now. I'd like to change it so that is covers something like three octaves without repeating itself.

From the code it looks like I need something like FIXBPERO=72 and MAXNOTES=36 and would certainly have to replace ECCtoHEX to implement my own note to color translation.

Any thoughts on this ?

out of the box -- configuration parameters comes up saturated 255 on ESP8266

Not sure if this is a known issue but, after a couple of days of digging through this project and getting a couple of different boards setup. I kept on running into crashes which I think is somehow related to the parameters for the following variables being incorrectly configured in the flash I believe.

extern uint8_t RootNoteOffset; //Set to define what the root note is.  0 = A.
uint8_t gDFTIIR = 6;
uint8_t gFUZZ_IIR_BITS = 1;
uint8_t gFILTER_BLUR_PASSES = 2;
uint8_t gSEMIBITSPERBIN = 3;
uint8_t gMAX_JUMP_DISTANCE = 4;
uint8_t gMAX_COMBINE_DISTANCE = 7;
uint8_t gAMP_1_IIR_BITS = 4;
uint8_t gAMP_2_IIR_BITS = 2;
uint8_t gMIN_AMP_FOR_NOTE = 80;
uint8_t gMINIMUM_AMP_FOR_NOTE_TO_DISAPPEAR = 64;
uint8_t gNOTE_FINAL_AMP = 12;
uint8_t gNERF_NOTE_PORP = 15;
uint8_t gUSE_NUM_LIN_LEDS = NUM_LIN_LEDS;
uint8_t gCOLORCHORD_ACTIVE = 1;
uint8_t gCOLORCHORD_OUTPUT_DRIVER = 0;

All of those were getting set to 255 and would I believe cause my setup to crash due to the miss configuration. After hand adjusting them in your awesome WEB page things work like a charm.

I have not had a chance to fish out exactly which one was causing my system to crash or why the values were flashed as 255. I'm just putting this out here in case someone else is struggling with ESP crashes just double check to see if you have your params set correctly..

Final note: I finally got this amazing platform up and running, and now I will start building IOT based Christmas decorations using Colorchord and some ws2812 leds.

unknown type name 'uint32_t' when compiling with the latest sdk

Getting an unknown type name 'uint32_t' error, only when using the latest esp-open-sdk (build with gcc 4.8.5 instead of 4.8.2). Here is the build log: http://paste.ubuntu.com/21643922/

The relevant part should be:

/home/confus/usr/build/esp-open-sdk/xtensa-lx106-elf/bin/xtensa-lx106-elf-gcc -mlongcalls -I/home/confus/usr/build/esp-open-sdk/sdk/include -Imyclib -Iinclude -Iuser -Os -I/home/confus/usr/build/esp-open-sdk/sdk/include/ -I../embeddedcommon -I. -Icommon -DICACHE_FLASH driver/uart.c common/mystuff.c common/flash_rewriter.c common/http.c common/http_custom.c common/mfs.c user/ws2812_i2s.c user/hpatimer.c user/custom_commands.c driver/adc.c ../embeddedcommon/DFT32.c ../embeddedcommon/embeddednf.c ../embeddedcommon/embeddedout.c user/user_main.c common/commonservices.c   -nostdlib -L/home/confus/usr/build/esp-open-sdk/sdk/lib -L/home/confus/usr/build/esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.5/libgcc.a /home/confus/usr/build/esp-open-sdk/sdk/lib/libmain.a /home/confus/usr/build/esp-open-sdk/sdk/lib/liblwip.a /home/confus/usr/build/esp-open-sdk/sdk/lib/libssl.a /home/confus/usr/build/esp-open-sdk/sdk/lib/libupgrade.a /home/confus/usr/build/esp-open-sdk/sdk/lib/libnet80211.a /home/confus/usr/build/esp-open-sdk/sdk/lib/libwpa.a /home/confus/usr/build/esp-open-sdk/sdk/lib/libnet80211.a /home/confus/usr/build/esp-open-sdk/sdk/lib/libphy.a /home/confus/usr/build/esp-open-sdk/sdk/lib/liblwip.a /home/confus/usr/build/esp-open-sdk/sdk/lib/libpp.a /home/confus/usr/build/esp-open-sdk/sdk/lib/libcrypto.a /home/confus/usr/build/esp-open-sdk/sdk/lib/libmain.a /home/confus/usr/build/esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.5/libgcc.a -T /home/confus/usr/build/esp-open-sdk/sdk/ld/eagle.app.v6.ld -Wl,-Map,output.map  -B/home/confus/usr/build/esp-open-sdk/sdk/lib -o image.elf
In file included from driver/uart.c:15:0:
/home/confus/usr/build/esp-open-sdk/sdk/include/ets_sys.h:14:1: error: unknown type name 'uint32_t'
 typedef uint32_t ETSSignal;
 ^

ColorChord EmbeddedCloud

p5_ws_samp_loop
colorchordembeddedcloud

Charles to me this embedded colochord is a wodefull engine for so many things A prolific author could make an entire book using this device as the starting point for so many studies, my imaginiation is overwhelmed.

You probably went to much work to get all the code and web pages on the processor. I have built this bleeding hack above using a clone of your DFT display to use P5.js WEBGL I know nothing of P5.js other than some research on the net for popular javascript tools and seemd to have excellent documentation and examples.

I have learned the SOFTAP mode is problematic so you seem to need to get into infra mode for any semblance of stability.

This opens up the embedded version to anyones favorite javascript tools

I all ready see my lack of experince need to understand how to get P5 canvas better placed

The first screengrab shows a P5.js DFT loop .

The second screen grab shows the furnace sound in the next room at the low frequencys and a radio in the same room at the upper frequencies.

My plan is collect DFT from 4 embedded colorchords , One would be considered master, the rest could be regular models.

Clearing rest of buffer in ws2812_push

I see is that WS2812_THREE_SAMPLE will clear rest of buffer (fill it with zeroes), while WS2812_FOUR_SAMPLE leaves rest of buffer intact.

Is this a mistake or I cannot understand something important about how it works?

work in bbkiwi's work.

@bbkiwi You've done a ton of work here, but there's some that I just don't feel is the right thing to put back into mainline. I like some of the features you've added. I'm rather surprised they don't come at an IRAM cost.

We can discuss some of the changes that we would want to bring into mainline here.

Where is settings.h?

Looking forward to trying the new version, but ...
user/custom_commands.c:7:22: fatal error: settings.h: No such file or directory
#include <settings.h>

Alternate Platform : Teensy

Have you considered porting to the Teensy?

It seems like a nice alternate. I am using it for lighting and DMX, and would love to integrate with ColorChord. Any guidance?

Thank you,

Greg

.bin for Wemos D1 Mini

Could someone post the firmware for colorchord 1 or 2 for the wemos d1 mini? I am having a hard time figuring out how to build this for the nodemcu/ wemos d1 mini

8266 - Scan completes, but the AP list disappears almost immediately

I can access the interface and am trying to set up station mode. When I press the Scan For Stations button, i get the "Scanning for WiFi..." message, system goes offline, I reconnect, system is back online with a message "Scan Complete". At this point a list of APs appears only briefly, disappears and I'm left with "No APs found. Did you scan?" Tested on Chromium (Arch Linux), Chrome (Windows) and Firefox (Windows).

EDIT: Similar issue already open #24

Switch digital pinout to TX?

Is there a way I can switch the digital pinout to TX?
I received a new type of board that has power drivers already builtin and am unable to change the pins they are connected to.,

Embedded 8266 - setup overview & performance/mic issue

Hi Charles - wondering if you might be able to assist troubleshooting:

  • environment setup via following on fresh install of ubuntu 16.04.1

https://gist.github.com/con-f-use/d086ca941c2c80fbde6d8996b8a50761

  • also:

apt-get install libpulse-dev libasound2-dev libx11-dev libxext-dev libxinerama-dev libusb-1.0-0-dev

  • added entry to /etc/bash.bashrc:

export ESP_ROOT='~/esp8266/esp-open-sdk'

  • update user.cfg reference for SDK to be esp_iot_sdk_v1.5.0 (rather than 1.5.2)
  • ran following with 3.3V usb-serial adaptor connected to esp:
  • embedded8266$ make all
  • embedded8266$ make burn
  • embedded8266$ make burnweb
  • (did receive an error on above "fatal: bad revision 'HEAD'" - related to git i think - but does compile & write)
  • 12kOhm pullup on electret microphone to 3.3V source, gives reasonably stable 0.5V DC offset at ADC, with range of say 0.4-0.6V or more when blowing into mic (reading from DMM only)
  • No response on physical ws2812b LED string when fed with esp Rx as data line
  • Can view responsive soundwave on oscilliscope at websockets page http://192.168.4.1/ but no data coming up in DFT, LEDs, or Notes sections.......?
  • have i missed something obvious here... everything otherwise seems to have gone well with environment setup & writing to chip! Do i need to run make in any other areas, or set some additional parameters in colorchord config files?

Initial response to above received via youtube, where original comment was posted -
CNLohr: You probably need to select the "Parameters" tab, and then click "Restore" and "Save"๏ปฟ


This seems to have worked - after Restore & Save in parameters section, can now view responsive DFT chart, and Notes sections of webpage.

However, still having issues getting correct operation - symptoms are:

  • with all webpage sections closed, 'System' runs at ~200Hz. With either Oscilliscope or DFT open, willdrop tobetween 15-40Hz..... (later improved when running in Windows web browser instead of ubuntu)
  • can get Notes to register & ws2812 LED string to light up, but only by blowing directly into microphone to overload with white noise. Whistling a stable loud tone directly next to microphone doesn't seem to produce a large enough waveform to come up with anything in DFT... maybe needs amp on the microphone, however believe should also be possible to get good functionality without...

Windows support with Cable/Virtual Audio Cable

Colorchord config:
https://hastebin.com/icehafarun.config
Demonstration/cpu usage
https://cdn.discordapp.com/attachments/262128321314291712/422647281720754176/2018-03-12_00-49-00.mkv

Windows audio config:
https://i.imgur.com/ZVqrJy0.png
https://i.imgur.com/HPq97eU.png
https://i.imgur.com/TpzepKe.png

Some things I immediately noticed:

  • It gets really slow if you have a size that's bigger then 640x480
  • FPS count is permanently broken
  • Slight delay sometimes with the audio (related to the resolution problem)

Overall, though, it's workable. Very dope program.

Colorchord won't start from commandline, without xserver

I was trying to run colorchord windowless on a linux system without xserver.
It terminated instantly,
commandline output:

Output Drivers:
OutputCells
DisplayHIDAPI
RecorderPlugin
OutputProminent
DisplayDMX
DisplayUSB2812
DisplayNetwork
DisplayPie
OutputLinear
DisplayArray
OutputVoronoi
null
Set: cpu_autolimit 1
Set: set_screenx 720
Set: set_screeny 480
Set: sample_channel -1
LF: fablab.conf
Set: outdrivers OutputLinear, DisplayNetwork
Set: satamp 1.600
Set: sourcename alsa_output.snd-0000_00_1b.0.analog-stereo.monitor
Set: amplify .3
Set: lightx 20
Set: lighty 20

fablab.conf :

#outdrivers = DisplayPie,DisplayNetwork, OutputLinear
outdrivers = OutputLinear, DisplayNetwork
leds = 46
light_siding = 1.0 #Turn this to ~1.9 for more uniformity, ~1.0 for less.
satamp = 1.600
is_loop=0
led_floor = .1 #Turn to .25 for more uniformity, .1 for less.
#note_attach_amp_iir = .3 #.3000
#note_attach_amp_iir2 = .15 #.1500
#note_attach_freq_iir = .3 #0.3000
steady_bright = 0
#dft_iir = 0.0
#dft_q = 20.0000
#dft_speedup = 1000.0000

sourcename = alsa_output.snd-0000_00_1b.0.analog-stereo.monitor
#sourcename = sysdefault

#alsa_output.pci-0000_00_1f.3.analog-stereo.monitor
skipfirst = 1
firstval = 1
port = 7777
address = 192.168.1.185

slope=.10
amplify=.3

lightx = 20
lighty = 20

Question about embeding in Respberry Pi zero

Hi
How should I embed the color chord onto a raspberry pi zero, please? I want to control a 300LED strip and due to the limitation in RAM space of the ESP8266, it can only do 255 LEDs. Should I first install ubuntu? Also, which ADC should I use?
Thanks...

ColorChordTimePloting

Charles! I have been playing with colorchord javascript and visualizations.
A couple days a go I realized that there was no spectral time plot?
screenshot at 2017-07-24 15 17 59

so here are the first few strums of "Dueling Banjo's".
you see sound coming from bottom of screen like standard DFT, but Alpha is used to modulate the brightness of display on only bottom of display
Colorchord octave coloring really enhances this type of display !!

First I add a line to index.html

<CANVAS style="background-image: url('http://localhost:8080/video');" id=DFTCanvas width="640" height="480" opacity="0.5" position="absolute" top="1px" left="1px" z-index="-1" > </CANVAS>

before the select WhichCanvas ( I like to have video background, if you run IP-Webcam on android it will pick it up, otherwise white background)
then changes to GotDFT

first version dissapointed me
now using
colorchord_pjm_2017-07-26_13-41-10

Well I was upset that I did not have old dft so here are the embedded8266/web/page files I am now using with the most recent colorchord git
ColorChordTimeLapse.zip

Above shows timelaspe data going up from middle of display but regular realtime DFT appears downwards though. Notice still gets 20Hz frame rate !!

A video of Scales Practice
scalespractice

Scales.zip

and zip of my latest web/page files
ColorScales.zip

This exercise has opened some bigger dreams in my head, say echo sounding, Charles have you considered to moving to the ESP32 and 16bit ADCs ?

Using this as a library

I would love to use all of the processing and note finding this does as a library.

Is that even possible? If it's not intended could you maybe stilll point me to the part of the code that takes in the audio stream and processes it, I might be able to cobble a solution together myself then

Outstanding job btw ๐Ÿ‘

./pushtodev doesn't properly transfer the site (and netburn doesn't work either)

I noticed that when I run:

./pushtodev 192.168.4.1      65536      page.mpfs

The page doesn't properly transfer with things missing and javascript errors. There seems to be some corruption, when writing to flash. I can't burn firmware over network either. Not by using the GUI nor by using the terminal programs. What's wrong here?

pushtodev-error

Using nodemcu, noise problems and a few bugs causing web gui to be sporadic

Hi Charles, You have a fantastic resource here. I have with much effort (due to little experience with git, c, virtualbox, linux, makefiles, websockets, electronics etc) managed to get both the embedded and non-embedded versions working. Especially useful was con-f-use/esp-clone.sh.

This has been a bit of a detour from my original goal of putting LEDs behind the head of my banjo uke that respond to the sound. I originally modified some adafruit 'color-organ' code so it would 'rotate' the pulsating LED images in response to the accents in my playing.
https://www.youtube.com/edit?o=U&video_id=jLgvuNdCXMU
https://www.youtube.com/edit?o=U&video_id=IRVPY4qavpc

I was in the process of getting it to react to freq when I saw your work. The idea of being able to connect via a web gui appealed.

What I have now (after changing your code as mentioned below) using a adafruit mic MAX4466 works perfectly when not serving up the webgui. If all the controls are closed (system 320hz), there is a bit of flashing of the LEDs from generated noise, but if I open the oscope, DFTs, LEDs or Notes, (running 170hz) lots of noise is generated and the LEDs flash from this noise. Even if I remove the mic, noise is still getting into the ADC.

At first the performance when serving the webgui was extremely inconsistent, it ran with 4 Hz sometimes, the controls and displays of oscope, etc didn't not always work. A few others have mentioned this behaviour in the earlier issues. I had to change the following:

  1. Makefile with the specifed user.cfg produced an index.html that double loads main.js and menuinterface.js and this really messes up things (don't quite know why, as developer tools for chrome and firefox show it loaded ok). FIXED this by removing lines 5-7 from web/index.html and added to user.cfg PAGE_SCRIPTS = main.js

  2. line 92 in main.js is missing a !
    It should contain: ... &&!pause_oscilloscope)?

  3. line 331 of main.js seems a bit different from the other commands, I think it should be
    if(!pause_notes )

  4. A number of variables in main.js and menuinterface.js are undeclared my web developer console flagged this. . I added var in front. I don't know how important this it.

I've attached a diff between what is in your repo and my changes. I'm still not sure how can make my own repo and request a pull :-0
diffs.txt

Cheers, Bill

ESP8266 page abnormal. How to upload?

A week ago I made it to work on a NodeMcu board. Later I built a stand alone board for it. I uploaded the two bin files and the page file. But something is wrong. The program seems to not work and the parameters are blank. I tried to upload the page file to 0x10000, 0x100000, and tried the system reflash function on the web page. I also tried using different browsers. None of them works.

img_2780
img_2712

Are there any suggestions? Thank you.

By the way, thanks for suggesting VB audio virtual cable. Like it.

Questions rather than issues - Embedded 8266

Hi @cnlohr, AWESOME work! Very impressive!

Context

Saw this via your IEEE article and wanted to reproduce for my sisters birthday (She's a sax player).
Have the code from the repo compiling and pushed to my device. My build chain is on a mac, so things were a little different; Also, i'd never touched the ESP8266 before, so getting the build environment up and working out howto build/flash was fun in itself. Many thanks to @con-f-use for GIST https://gist.github.com/con-f-use/d086ca941c2c80fbde6d8996b8a50761 and #12 for helping me around the latest SDK build issues.

It's working but I have a couple of questions before i feel confident packaging this up as 'properly working' (Planning to blog this after with build steps for Mac and all the relevant credit ๐Ÿ‘ ).

My question's

  1. Mic, Electret mic via a simple pull up resistor and capacitor to input seems to work but requires very loud inputs. pre-amplified to signal-level for things like arduino however seems to overload the input and send the input crazy even in silence. I noticed in bits of your documentation you talk about <1v peak on the mic input, could you give me a little more info on what the chip/code is expecting and your setup for a Mic..
  2. Web Interface, all working apart from the 'notes' section. 'notes' just loads the empty div with the 'pause' button in and nothing much else. I'll follow issue #15 where you have uploaded a copy of your web content and will try that, just seems strange that everything else works bar this.
  3. General configuration... The docs say I should be tuning things via the pre-processor macros.. yet I seem to be able to change vars in the web interface too. Is this left over from non-embedded colorchord and shouldn't be used? I'm trying to make the LEDs more stable. At the moment i get an occasional lightup when there is no music and I have to be very close to the mic with very loud notes to get a read. I'm hoping this is just due to the first part of my question RE microphone. However I want to know, if I do want to try tweaking FIXBPERO, DFTIIR, Aplitude for notes dissapearing etc... should I only be changing these at compile time, us is the UI safe to use?

I appreciate you probably don't want all these questions; But any help would be greatly received!

Matt

CNLohr's version of the SDK does not work with the current version of colorchord

Just wanted @cnlohr to be aware the the current version of colorchord doesn't work with https://github.com/cnlohr/esp_nonos_sdk

/home/confus/usr/build/esp-open-sdk-CNLohr/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.5/../../../../xtensa-lx106-elf/bin/ld: image.elf section `.text' will not fit in region `iram1_0_seg'
/home/confus/usr/build/esp-open-sdk-CNLohr/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.5/../../../../xtensa-lx106-elf/bin/ld: region `iram1_0_seg' overflowed by 288 bytes
collect2: error: ld returned 1 exit status
esp82xx/main.mf:79: recipe for target 'image.elf' failed
make: *** [image.elf] Error 1

Even after I bumped esp82xx to the latest dev version and added the missing user_rf_cal_sector_set() in ./user/user_main.c.

Interference with ADC in station mode (SOLVED)

With the latest commit 095ca using latest esp82xx, I get spurious signal into the ADC when in station mode and connected to the gui. This does not happen when connected to the gui in AP mode or when not connected to the gui in either mode.

The interference seems to start about 4 min after connecting to the station. Initially the oscope shows no glitches but they develop after a time. My real oscope at A0 does not show any blips even when they show in the gui oscope.

I've made a video showing what happens.
https://youtu.be/5993kTh8T9I

Here is what the oscope looks like when AP starts
https://youtu.be/6JzNtNrRPF0

Arduino Support?

Hey Charles, hey guys,

Im getting used to C programming but understanding your code is not very easy and the comments in code and configs dont help a lot. Id really love to run my WS2812Bs like in your PC Build. They are connected to an Arduino Uno, an Atmel 328P, that is connected via USB to my PC.
Could you help me set this up?

region `iram1_0_seg' overflowed by 2936 bytes

First, let me apologise for the newbie question. Im having major issues with compiling colorchord for ESP8266, I understand that issues are generally caused by newer versions of the sdk. I have downloaded and linked in the older versions that cnlohr has provided with no avail. Suggestions on things to check ?

Strange behavior of USE_2812_INTERRUPTS

Hi guys, before next Sysadmin's day I'm back with our lightbanner :)

Previous year we had a problem with freezing colorchord after 5-15 minutes of running.
Now I tried to get fresh sources of everything and check if it still has freezing - and yes, I got it freezed after some time of smooth running.

I checked that ledOut array still works and filled with right values (I can see oscilloscope and LEDs on webpage), so problem can be in ws2812_i2s driver.

And.. USE_2812_INTERRUPTS - should it be defined or not?

I see two places in ws2812_i2s.c where it used with #if and two places where it checked with #ifdef.
Hmm.. as my compiler says to me that I should define it to be checked with #if, I defined it with value of 0. But if we will see to sources, we can see that it will be reason of DMA re-initialization each time ws2812_push is called (and interrupt routine fully commented out). Maybe this is a root of my problem?

Thanks!

Not compiling for windows

After a long struggle with MinGW and Cygwin I have finally given up after having partial success with Cygwin.

The only dependency not available for windows is the alsa sound lib - specifically alsa/asoundlib.h

Please post if I am missing something or if this will never work on windows.

Roan

Performance issues

I'm getting about 3-6 fps on the voronoi output.

I'm running Ubuntu 14.04 on a rig with an AMD FX6100 cpu. Should be more than enough processing power. Using the default .conf file. Tried playing around with the settings to improve performance with no success.

Here is the CPU usage. You can clearly see the spike when I launched colorchord, but after that it's not utilizing 100% of the cpu, which is weird. You'd think if it was starting to freeze up the whole computer it would be maxing out the CPU.

image

[Question] Single out

In my understanding, this program is designed to drive multiple leds. Would it also by any means be possible to just take the most prominent "color" or sound and display it on only one LED/output? (Thinking about conventional LED strips that just have one color input)

`.text' will not fit in region `iram1_0_seg'?

Hi,
I'm a newb trying to get colorchord embedded running on an esp8266. When I try to build the project I get the following errors. I'm using sdk 1.5.4.1.

../esp8266/esp-open-sdk/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.5/../../../../xtensa-lx106-elf/bin/ld: image.elf section .text' will not fit in regioniram1_0_seg'
Makefile:72: recipe for target 'image.elf' failed
../esp8266/esp-open-sdk/xtensa-lx106-elf/bin/../lib/gcc/xtensa-lx106-elf/4.8.5/../../../../xtensa-lx106-elf/bin/ld: region `iram1_0_seg' overflowed by 1956 bytes

Any thoughts?
Thanks

Wiring setup

Hi Charles awesome project, I'm sorry I didn't want to open an issue this stupid, but I haven't found anywhere how to do it. I have an esp8266 (nodemcu v3) and a Groove - Loudness Sensor based on LM2904 amplifier, I've successfully flashed the firmware and uploaded the web interface (make netburn) and I've used the RX and TX pins on the esp for the mic input and led strip output (respectively) but I get nothing but noise, that's why I wanted to know if I should use other pins. Here's a picture of what I refer to as noise (it's present even if there's noting connected to the board):

captura de pantalla 2017-08-06 a la s 12 28 16

Question building for Windows.

Hello,
I tried building colorchord for Windows 10 and it looks like this
image

The audio works fine but there is no visual output. Is there something I need to configure? Thank you.

Can't make it work

hi

I really like this, after compile it in lubuntu

I tried to run it but it does not work

into de directory, I type

./colorchord default.conf

but does not do anything

in the screen shows "Pulse: from: (null) (PA Test) / 44100x2 (128)"

please help me

Tks

embedded8266; No Output to WS2812

Trying to get the colorchord/embedded8266 code up and running, but I am not getting any output to
the ws2812 strip. I can see data in the oscilloscope, but never anything on the DFT canvas, and no
output to the strip.
I did previously get the esp8266ws2812i2s code running, and the strip works with the "top" program as
expected.
Any hints? -- Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.