Is this the ultimate DIY hardware VU meter?
Is this the ultimate DIY hardware VU meter? Posted on: 28.09.2010 by Arcelia Siebeneck Midi2LCD v0.1 - Windows only.http://www.youtube.com/watch?v=6AUQUGt6wlQ You don't actually need a usb LCD like I'm using in the video above. The included "LCD Smartie" program will emulate the LCD screen whilst you tweak things (or wait for your LCD screen to arrive in the post!). First of all you're going to need a virtual midi port utility - I recommend LoopBe1 (which is free). Next, download and extract http://www.nicholas-johnson.com/stuff/Midi2LCD.zip somewhere and then run Traktor. Setup Traktor as per "how to setup Traktor.jpg". Next run "LCDSmartie.exe" followed by "Midi2LCD_v0.1.exe". Midi2LCD will now ask you to setup the midi ports - make sure you choose LoopBe as your midi input (or whatever virtual midi port software you're using). DON'T choose the same midi port as your output otherwise you'll get a feedback loop. If you've done all of the above correctly, you should now see the VU meters in Traktor being displayed on the LCD Smartie simulated screen (as well as on your USB LCD screen, if you have one). I've enclosed the source files in the zip file - anyone who knows how to use AHK should edit \Midi2LCD\LCDSmartie\AHK\source\MidiRules.ahk if they want to add extra midi functions. Original post:
First of all, maximum respect to thelpb who gave me the idea for this project (he's working on the same thing himself). My LCD's arrived in the post this morning so I thought I'd knock something together in Autohotkey rather than wait for him to finish his midi dll for LCD Smartie. Anyway, nevermind all the technical stuff... check the proof of concept video out: (excuse the quality)
http://www.youtube.com/watch?v=7I9Pr39qaso So yeah, it's a bit rough around the edges at the moment and only displays midi CC values (0-127)... once I've worked on it some more it should look more like a traditional VU meter, more like: Code:
Deck A []|||||||||||| [] Deck B []|||||| [] I'll be uploading the scripts and a how-to later, once it's a bit more polished looking | |
Chasidy Heckenbach 27.05.2012 |
Originally Posted by MiL0
and yeah, i saw that you're contributing to the mixxx development now... nice one
if mixxx runs too slowly on the Pi, I wonder how hard it'd be to write/modify an existing media player so that it could be used as the basis of a cdj-style midi controller... |
Shaniqua Nobe 24.05.2012 | absolutely - arduino is a computer the size of a matchbook - anything one can do with a really old computer can be done with it (about the power of an 286).
Originally Posted by escapemcp
|
Louisa Oberc 12.02.2011 |
Originally Posted by MiL0
Code:
#include "Midi.h" //from: http://timothytwillman.com/itp_blog/?page_id=240 #define NUM_LEDS_CH1 12 #define NUM_LEDS_CH2 12 #define LATCH_CH1 6 #define CLOCK_CH1 5 #define DATA_CH1 7 #define LATCH_CH2 9 #define CLOCK_CH2 8 #define DATA_CH2 10 #define CHANNEL_A_LEVEL 1 //CC# #define CHANNEL_B_LEVEL 2 //CC# class MyMidi : public Midi { public: MyMidi(HardwareSerial &s) : Midi(s) {} void handleNoteOn(unsigned int channel, unsigned int note, unsigned int velocity) {digitalWrite(13, HIGH);} void handleNoteOff(unsigned int channel, unsigned int note, unsigned int velocity){digitalWrite(13, LOW);} void handleControlChange(unsigned int channel, unsigned int controller, unsigned int value) { if (channel != 4) return; // we only are about channel 4 atm if (controller == CHANNEL_A_LEVEL) { byte mapped = map(value,0,127,0,NUM_LEDS_CH1); unsigned int graphCh1 = 0; for (byte i=0;i<mapped;i++) bitSet(graphCh1,i); digitalWrite(LATCH_CH1, LOW); shiftOut(DATA_CH1, CLOCK_CH1, MSBFIRST, highByte(graphCh1)); shiftOut(DATA_CH1, CLOCK_CH1, MSBFIRST, lowByte(graphCh1)); digitalWrite(LATCH_CH1, HIGH); } if (controller == CHANNEL_B_LEVEL) { byte mapped = map(value,0,127,0,NUM_LEDS_CH2); unsigned int graphCh2 = 0; for (byte i=0;i<mapped;i++) bitSet(graphCh2,i); digitalWrite(LATCH_CH2, LOW); shiftOut(DATA_CH2, CLOCK_CH2, MSBFIRST, highByte(graphCh2)); shiftOut(DATA_CH2, CLOCK_CH2, MSBFIRST, lowByte(graphCh2)); digitalWrite(LATCH_CH2, HIGH); } } }; MyMidi midi(Serial); void setup() { pinMode(LATCH_CH1, OUTPUT); pinMode(DATA_CH1, OUTPUT); pinMode(CLOCK_CH1, OUTPUT); pinMode(LATCH_CH2, OUTPUT); pinMode(DATA_CH2, OUTPUT); pinMode(CLOCK_CH2, OUTPUT); digitalWrite(LATCH_CH1, LOW); shiftOut(DATA_CH1, CLOCK_CH1, MSBFIRST, 0); shiftOut(DATA_CH1, CLOCK_CH1, MSBFIRST, 0); digitalWrite(LATCH_CH1, HIGH); digitalWrite(LATCH_CH2, LOW); shiftOut(DATA_CH2, CLOCK_CH2, MSBFIRST, 0); shiftOut(DATA_CH2, CLOCK_CH2, MSBFIRST, 0); digitalWrite(LATCH_CH2, HIGH); // Serial.begin(9600); midi.begin(0); // Serial.println("Begin"); } void loop() { midi.poll(); } |
Arcelia Siebeneck 12.02.2011 |
Originally Posted by BennyJ
Originally Posted by BennyJ
The easiest thing to do would be to buy the USB LCD display that I linked to in my first post. Then you can use your pc and some software to control the LCD (make it display VU meters etc). Otherwise, you'll have to wait until someone gets it all working via an Arduino. |
Arcelia Siebeneck 11.02.2011 | yeah the Arduino would receive inputs from buttons, encoders and potentiometers as well as output to an LCD display. My goal is to create a script that allows all these features and that anyone can upload to a ~ |
Matha Obray 11.02.2011 |
Originally Posted by MiL0
|
Chasidy Heckenbach 27.05.2012 |
Originally Posted by MiL0
and yeah, i saw that you're contributing to the mixxx development now... nice one
if mixxx runs too slowly on the Pi, I wonder how hard it'd be to write/modify an existing media player so that it could be used as the basis of a cdj-style midi controller... |
Arcelia Siebeneck 24.05.2012 | hmm if you order one now you probably won't get it until July at the earliest. I've actually paid for two so when my 2nd one turns up I'd be happy to sell it you at cost price. and yeah, i saw that you're contributing to the mixxx development now... nice one if mixxx runs too slowly on the Pi, I wonder how hard it'd be to write/modify an existing media player so that it could be used as the basis of a cdj-style midi controller... |
Chasidy Heckenbach 25.05.2012 | it *may* be too underpowered for mixxx - tho it runs fine on netbooks. i need to check the spec of the RPi again. i entered my email address into the RS website today actually - to hopefully get one sometime. tho just remembered now that u posted some link the other month for pre-ordering or something? i was out of cash at the time. any clue the best way to try and get hold of one? today i wrote my first bit of code for mixxx - implemented a spinback and brake effect for the mixxx core the last couple of weeks have just been writing mappings in javascript - to hopefully get in the 1.11 release. if you have issues with mixxx - then there's the bug tracking system, mailing list and irc channels to let people know about them |
Arcelia Siebeneck 25.05.2012 | yeah hopefully my RPi will arrive in June then I'm gonna start working on a cdj-style controller again (if I can get Mixxx to work ) |
Chasidy Heckenbach 24.05.2012 | wow - necro thread probably better to pick up a rasberry pi now for something like this - almost full pc power in the size of a matchbox |
Shaniqua Nobe 24.05.2012 | absolutely - arduino is a computer the size of a matchbook - anything one can do with a really old computer can be done with it (about the power of an 286).
Originally Posted by escapemcp
|
Sulema Eshel 04.11.2011 | Could you use these for creating an S4-like loop size monitor? Using the output from the "loop size" midi out command, and limiting the midi-range to 10 (so that it outputs from 0-10 CC values), would there be any way of translating these 11 states to reflect the loop size e.g. MIDI CC OUT | TEXT DISPLAYED ON LCD 0 | 1/32 1 | 1/16 2 | 1/8 ... 9 | 16 10 | 32 Have been looking for a way to do this for ages, but without success... would this be possible, or can it only display the "raw" cc data output? Many thanks & great work achieved (so far)! escapemcp. |
Lillia Mestdagh 09.05.2011 | Just got my Arduino code working ... Twin VU meter that can be assigned to any MIDI CC number(s). Works exactly the same as MiL0's LCD, just for Arduino To use this code with Arduino you will need this MIDI library installed... http://timothytwillman.com/itp_blog/?page_id=240 This code assumes you have working MIDI I/O hardware on your Arduino and a working LCD display. Don't forget to change the LCD pin numbers to the pins you are using! My pin config is different to the Arduino examples as I have a custom Arduino board. For more info on LCD, see this Arduino page ... http://arduino.cc/en/Tutorial/LiquidCrystal PHP Code:
|
Louisa Oberc 12.02.2011 | Heh, beat me to it keep in mind that the more stuff you are doing (writing to lcd's, turning leds on and off, etc) the less time you have to process midi... and beyond anything else, midi latency is a no-no... One solution (which is what I will likely use on my controller) is to use two arduino's, one for midi input (leds/lcd) and one for midi output... Getting two arduinos talking to each other is pretty trivial... Other option would be to move up to a faster microprocessor, but that is beyond my skill set at the moment |
Louisa Oberc 12.02.2011 | you mean a normal lcd 2x20 type screen right? not the ones you have in your cdj2000 style build... More flexibility for sure, but not so much less wiring in the sense of the pin requirements of lcd's over using leds with multiplexers (64+ leds using 3 pins vs 7 pins for each lcd) They're fairly easy to program, however it can depend on the type of screen you have. The one you posted about is usb based... talking usb from an arduino is not an easy task... I would likely go with one like this: http://www.sparkfun.com/products/256 It's pretty much the same thing, but without the usb controller built in... the downside is that it takes 7 digital pins to use (when used in 4bit mode).. There is plenty of example code out there... it can be as simple as this: Code:
while (analogRead(aPinIn) == 0) { if (dispWaiting) { lcd.clear(); lcd.setCursor(centerText("No Resistor..."),0); lcd.print("No Resistor..."); lcd.setCursor(centerText("Waiting"),1); lcd.print("Waiting"); dispWaiting = false; } } |
Arcelia Siebeneck 12.02.2011 | nice work man - you're definitely an asset on these community
s! I can't wait until my arduino arrives so I can try some of this stuff out. I believe it might be more useful to use an LCD display like my original post though, rather than LED's. Should mean less wiring but also an LCD display is arguably more versatile than LED's. Any ideas how easy it is to program LCD display code for the Arduino? edit: ah, there's a library here: http://www.arduino.cc/en/Tutorial/LCDLibrary looks really straightforward! should be fairly trivial to get a VU meter working... edit2: check out this colour LCD arduino shield: for sale here for $19.95: [ame="http://www.amazon.com/RGB-LCD-Shield-Arduino-color/dp/accessories/B003MTT0ZW"]Amazon.com: RGB LCD Shield for Arduino 65K color KIT: Electronics@@AMEPARAM@@http://ecx.images-amazon.com/images/I/512Lf%2BrPEmL.@@AMEPARAM@@512Lf%2BrPEmL[/ame] edit3: and here's a more standard LCD display like I used in my original post: [ame="http://www.amazon.com/LCD-Module-Arduino-White-Blue/dp/B003B258BU"]Amazon.com: LCD Module for Arduino 16 x 2, White on Blue: Everything Else@@AMEPARAM@@http://ecx.images-amazon.com/images/I/31P-Mk4fjgL.@@AMEPARAM@@31P-Mk4fjgL[/ame] |
Louisa Oberc 12.02.2011 | Ok, I was bored, so I whipped this up... I havent tested it, but from memory it should be right... Edit: minor correction to the schematic... R26 (in the midi in section) should be a 1k resistor |
Louisa Oberc 12.02.2011 |
Originally Posted by MiL0
Code:
#include "Midi.h" //from: http://timothytwillman.com/itp_blog/?page_id=240 #define NUM_LEDS_CH1 12 #define NUM_LEDS_CH2 12 #define LATCH_CH1 6 #define CLOCK_CH1 5 #define DATA_CH1 7 #define LATCH_CH2 9 #define CLOCK_CH2 8 #define DATA_CH2 10 #define CHANNEL_A_LEVEL 1 //CC# #define CHANNEL_B_LEVEL 2 //CC# class MyMidi : public Midi { public: MyMidi(HardwareSerial &s) : Midi(s) {} void handleNoteOn(unsigned int channel, unsigned int note, unsigned int velocity) {digitalWrite(13, HIGH);} void handleNoteOff(unsigned int channel, unsigned int note, unsigned int velocity){digitalWrite(13, LOW);} void handleControlChange(unsigned int channel, unsigned int controller, unsigned int value) { if (channel != 4) return; // we only are about channel 4 atm if (controller == CHANNEL_A_LEVEL) { byte mapped = map(value,0,127,0,NUM_LEDS_CH1); unsigned int graphCh1 = 0; for (byte i=0;i<mapped;i++) bitSet(graphCh1,i); digitalWrite(LATCH_CH1, LOW); shiftOut(DATA_CH1, CLOCK_CH1, MSBFIRST, highByte(graphCh1)); shiftOut(DATA_CH1, CLOCK_CH1, MSBFIRST, lowByte(graphCh1)); digitalWrite(LATCH_CH1, HIGH); } if (controller == CHANNEL_B_LEVEL) { byte mapped = map(value,0,127,0,NUM_LEDS_CH2); unsigned int graphCh2 = 0; for (byte i=0;i<mapped;i++) bitSet(graphCh2,i); digitalWrite(LATCH_CH2, LOW); shiftOut(DATA_CH2, CLOCK_CH2, MSBFIRST, highByte(graphCh2)); shiftOut(DATA_CH2, CLOCK_CH2, MSBFIRST, lowByte(graphCh2)); digitalWrite(LATCH_CH2, HIGH); } } }; MyMidi midi(Serial); void setup() { pinMode(LATCH_CH1, OUTPUT); pinMode(DATA_CH1, OUTPUT); pinMode(CLOCK_CH1, OUTPUT); pinMode(LATCH_CH2, OUTPUT); pinMode(DATA_CH2, OUTPUT); pinMode(CLOCK_CH2, OUTPUT); digitalWrite(LATCH_CH1, LOW); shiftOut(DATA_CH1, CLOCK_CH1, MSBFIRST, 0); shiftOut(DATA_CH1, CLOCK_CH1, MSBFIRST, 0); digitalWrite(LATCH_CH1, HIGH); digitalWrite(LATCH_CH2, LOW); shiftOut(DATA_CH2, CLOCK_CH2, MSBFIRST, 0); shiftOut(DATA_CH2, CLOCK_CH2, MSBFIRST, 0); digitalWrite(LATCH_CH2, HIGH); // Serial.begin(9600); midi.begin(0); // Serial.println("Begin"); } void loop() { midi.poll(); } |
Matha Obray 13.02.2011 | Ah ok makes sense |
Arcelia Siebeneck 12.02.2011 |
Originally Posted by BennyJ
Originally Posted by BennyJ
The easiest thing to do would be to buy the USB LCD display that I linked to in my first post. Then you can use your pc and some software to control the LCD (make it display VU meters etc). Otherwise, you'll have to wait until someone gets it all working via an Arduino. |
Matha Obray 11.02.2011 | Would this work? http://www.sureelectronics.net/goods.php?id=1097 Or could i use this http://www.sparkfun.com/products/9937 |
Matha Obray 11.02.2011 | But how many? I want to do a 4 channel mixer with a 4 band eq |
Arcelia Siebeneck 11.02.2011 | yeah the Arduino would receive inputs from buttons, encoders and potentiometers as well as output to an LCD display. My goal is to create a script that allows all these features and that anyone can upload to a ~ |
Matha Obray 11.02.2011 |
Originally Posted by MiL0
|
Arcelia Siebeneck 11.02.2011 | yeah - you can configure the software to display whatever you like on each VU. If you buy a 4 x width LCD display then you could display 4 decks' VU meters at the same time theoretically. Let me know what you have in mind and I'll reprogram the utility to fit your needs. In the medium/long term however, I'm looking to replace the USB LCD display with an LCD display that hooks directly up to an Arduino. This means you shouldn't need to run any immediadery software and everything should be plug'n'play. Apart from providing OSX compatibility (which wasn't possible before), it'll mean that anyone who's designing a new DIY controller should be able to use Arduino as the usb midi brain with an easy to implement VU meter. |
Matha Obray 11.02.2011 | Hmmm im believeing about using this on a custom mixer i might make...but is there a way to split the vu's per deck..and run them to individual channels on a mixer's vu indicators? |
Arcelia Siebeneck 18.01.2011 | don't shoot the messenger! I can't get mac support working unless there are OSX drivers for the LCD and someone ports AHK to Mac, which is unlikely to put it mildly |
Loralee Cherpak 19.01.2011 | mac :,( |
Chau Honrado 28.12.2010 | yea in the same boat as oskars, love the hack! but very firmly based in macland |
Wava Egizi 29.09.2010 | Not very kool But I love the idea and your project! |
Arcelia Siebeneck 29.09.2010 | Autohotkey is PC only (Apple don't allow the kind of control that AHK gives you over the operating system unfortunately). Also, LCD Smartie isn't available for OSX afaik. So the answer is no, and very unlikely to happen. |
Wava Egizi 29.09.2010 | Doesn't work with Mac right? |
Arcelia Siebeneck 29.09.2010 | first post updated - all the files are included and you don't even need a USB LCD screen to get started! |
Arcelia Siebeneck 29.09.2010 | sent you an email with all the details... let me know how you get on |
Lala Cortina 29.09.2010 |
Originally Posted by MiL0
|
Arcelia Siebeneck 29.09.2010 | do you have AIM/msn/email? pm me your details and I'll send you the files so we can both work on this |
Lala Cortina 29.09.2010 | Can't tease me like that and not share! :P |
Arcelia Siebeneck 29.09.2010 | Finished: http://www.youtube.com/watch?v=6AUQUGt6wlQ I'll clean up the code and get something uploaded as soon as possible |
Joan Kollmorgen 29.09.2010 | Nice work - look forward to seeing your progress |
<< Back to Reviews of DJ equipment Reply