MiniDexed icon indicating copy to clipboard operation
MiniDexed copied to clipboard

Midi led indicator

Open craigyjp opened this issue 3 years ago • 17 comments

Just wondering if it's possible to use a couple of gpio pins or maybe just one to indicate midi activity? I can easily add it on the UART input and output by buffering these lines to drive LEDs, but it would be nice if any USB or DIN midi was indicated.

craigyjp avatar Apr 22 '22 18:04 craigyjp

I was actually wondering whether we should use the Raspberry Pi built-in LED to blink (mActLED.Blink) when there are MIDI messages. Would it interfere with sound performance @rsta2?

probonopd avatar Apr 22 '22 18:04 probonopd

I don't know how that would work on a pi400 as I don't have access to these LEDs to bring to a front panel.

craigyjp avatar Apr 22 '22 18:04 craigyjp

Wait, you are "wasting" a percious 400 for MiniDexed? ;-)

probonopd avatar Apr 22 '22 18:04 probonopd

Like I said, it's currently all I can get hold of here in the Ukraine, there is a bad man called Putin making things hard for me, I will swap it out with a Pi 3 when I get the chance.

craigyjp avatar Apr 22 '22 18:04 craigyjp

Like I said, it's currently all I can get hold of here in the Ukraine, there is a bad man called Putin making things hard for me, I will swap it out with a Pi 3 when I get the chance.

Please send me an email. I will try to send you a RPi3.

dcoredump avatar Apr 22 '22 19:04 dcoredump

I appreciate your offer, but please you don't have to. We are probably going to try to relocate to Bulgaria in the next few weeks depending on how it goes, currently we are safe in Dnipro and not in any danger (yet). The reason we have not left is we have an 18 year old son and we can't cross the border with him as he of fighting age, but he is slightly disabled so we are trying to get docs to allow him to cross the border. We should have these soon. Any postage might take 3-4 weeks to arrive and by that time we will be gone or dead, not sure which.

craigyjp avatar Apr 22 '22 19:04 craigyjp

At the moment the Act LED is dedicated for the SD card activity. I think CActLED::Blink() cannot be used for that purpose, because it pauses the execution for the given blink time. Instead you have to use CActLED::On() and CActLED::Off() and use a kernel timer, which is started, when a MIDI event comes in, and canceled and restarted, when another event arrives. When the kernel timer expires after say 20ms, it switches the LED off.

rsta2 avatar Apr 23 '22 08:04 rsta2

Exceeds my C++ skills for the moment. If anyone wants to implement it, a PR would be welcome.

probonopd avatar Apr 23 '22 08:04 probonopd

Managed to get a Pi 4 today, mounted it in my case so I have access to the SD card for future releases.20220423_152035.jpg

craigyjp avatar Apr 23 '22 12:04 craigyjp

Not so sure I like what I am seeing with regards to mains power... it could be very dangerous. At the very least use some shrink tubing! But I am not an eletrician, so I strongly advise anyone to use an unmodified USB power supply.

probonopd avatar Apr 23 '22 17:04 probonopd

Yeah I understand, but it's in a 3mm thick plastic box so well insulated. I have some shrink tubing I should stick over those terminals and the power switch, I was just being lazy as I used shrink on the led connections.

craigyjp avatar Apr 23 '22 18:04 craigyjp

Yeah I understand, but it's in a 3mm thick plastic box so well insulated. I have some shrink tubing I should stick over those terminals and the power switch, I was just being lazy as I used shrink on the led connections.

I am an electrocian and I would highly recommend to insulate all mains voltage contacts somehow! At least with insulating tape but heat shrink tubing is usually better because no adhesive that gets old is involved.

dcoredump avatar Apr 24 '22 11:04 dcoredump

Next time I pop the lid off I will add some, I have been into electronics for 48 years now, pretty sure it's safe, no one but me will ever open it. Well maybe the Russians will if they loot it from my house with the rest of the Ukrainian peoples property.

craigyjp avatar Apr 24 '22 11:04 craigyjp

My old D110 (the successor of the MT-32) had a kind of level-meter on the display for every part. I made the same for the two instances of Dexed for MicroDexed, so no LEDs and GPIOs are involved. And the Raspi has much more CPU power than a Teensy. The update of the LCD does not need to be done at audio rate, it is totaly ok when updating at control rate (maybe 10 times a second).

dcoredump avatar Apr 24 '22 11:04 dcoredump

That's a nice idea, I have an SC55 which does the same thing, shows you which TG is getting activity. Would be good to see based on velocity levels 0-127 I guess, or just blocks for each TG.

On Sun, 24 Apr 2022, 14:40 Holger, @.***> wrote:

My old D110 (the successor of the MT-32) had a kind of level-meter on the display for every part. I made the same for the two instances of Dexed for MicroDexed, so no LEDs and GPIOs are involved. And the Raspi has much more CPU power than a Teensy. The update of the LCD does not need to be done at audio rate, it is totaly ok when updating at control rate (maybe 10 times a second).

— Reply to this email directly, view it on GitHub https://github.com/probonopd/MiniDexed/issues/143#issuecomment-1107823506, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMFJTAOZBB3UI5ZHIWYWPNDVGUXLTANCNFSM5UDBWVRA . You are receiving this because you authored the thread.Message ID: @.***>

craigyjp avatar Apr 24 '22 11:04 craigyjp

That's a nice idea, I have an SC55 which does the same thing, shows you which TG is getting activity. Would be good to see based on velocity levels 0-127 I guess, or just blocks for each TG.

On Sun, 24 Apr 2022, 14:40 Holger, @.***> wrote:

My old D110 (the successor of the MT-32) had a kind of level-meter on the display for every part. I made the same for the two instances of Dexed for MicroDexed, so no LEDs and GPIOs are involved. And the Raspi has much more CPU power than a Teensy. The update of the LCD does not need to be done at audio rate, it is totaly ok when updating at control rate (maybe 10 times a second).

I created a full block when a keydown MIDI event arrives on a channel. If a keyup occurs a "blank icon" is displayed. Between those events (inside control rate) I slowly count down and show icons with lower "black" parts until only one black line at the bottom is left (you only have 5*8 pixels, so 8-1 states are shown). This line is also shown for sustained notes and disapears after sustain is released.

dcoredump avatar Apr 24 '22 17:04 dcoredump

I did something similar with a Roland A110 emulator that I built recently.

On Sun, 24 Apr 2022, 20:35 Holger, @.***> wrote:

That's a nice idea, I have an SC55 which does the same thing, shows you which TG is getting activity. Would be good to see based on velocity levels 0-127 I guess, or just blocks for each TG.

On Sun, 24 Apr 2022, 14:40 Holger, @.***> wrote:

My old D110 (the successor of the MT-32) had a kind of level-meter on the display for every part. I made the same for the two instances of Dexed for MicroDexed, so no LEDs and GPIOs are involved. And the Raspi has much more CPU power than a Teensy. The update of the LCD does not need to be done at audio rate, it is totaly ok when updating at control rate (maybe 10 times a second).

— Reply to this email directly, view it on GitHub #143 (comment) https://github.com/probonopd/MiniDexed/issues/143#issuecomment-1107823506 , or unsubscribe

https://github.com/notifications/unsubscribe-auth/AMFJTAOZBB3UI5ZHIWYWPNDVGUXLTANCNFSM5UDBWVRA . You are receiving this because you authored the thread.Message ID: @.***>

I created a full block when a keydown MIDI event arrives on a channel. If a keyup occurs a "blank icon" is displayed. Between those events (inside control rate) I slowly count down and show icons with lower "black" parts until only one black line at the bottom is left (you only have 5*8 pixels, so 8-1 states are shown). This line is also shown for sustained notes and disapear after sustain is released.

— Reply to this email directly, view it on GitHub https://github.com/probonopd/MiniDexed/issues/143#issuecomment-1107884913, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMFJTAPBB6ISSEK5HRW2VOTVGWA6VANCNFSM5UDBWVRA . You are receiving this because you authored the thread.Message ID: @.***>

craigyjp avatar Apr 24 '22 17:04 craigyjp