You can power multiple devices with just one input source if needed by implementing various voltage regulators or converters.
For example, it's common to have a circuit board with multiple voltage requirements. The board might have switching regulators (buck/boost), linear regulators (LDO), transformers, etc. Often in an assembled device (like a desktop computer) the job of supplying different voltages is handled by the power supply.
The first thing to do is determine how much power every device will use, whether these are components on a PCB or separate devices in an enclosure.
- The Raspberry Pi 4 specs show that it needs 5V DC at ≥ 3A. If USB ports on the Pi aren't providing more than 500mA, it mentions you can use a 2.5A supply.
- I'll assume your MIDI keyboard is a controller and not a synth, and further that it is USB 2.0 compatible. Most devices like this use < 500 mA.
- The LED strip is the ambiguous item from your question. A general rule of thumb is to take the number of discrete elements (individual diodes) and multiply by 20 mA. Note that by "individual diodes" I mean the red, green, and blue diodes inside each pixel. If your strip has 100 white LEDs or pixels, then that would be 300 diodes x 20mA = 6A. This would be the current it draws at maximum brightness, full white.
At this point you can add up the requirements to get an idea what size power supply would be needed. I'll use 100 white pixels for the LED strip as an example. Calculating the power used gives us a useful spec for sizing the main power supply:
- 5V 3A (15 W)
- 5V 500mA (2.5 W)
- 12V 6A (72 W)
From this, we know that we need a power supply capable of ≥ 89.5 watts. It is good practice to plan for inefficiency and build a little overhead into your design. Based on this, I'd consider a 100 or 120 watt supply.
The next step is to consider some options:
- A 5 volt supply with a 12 volt boost regulator to power the LEDs;
- A 12 volt supply with a 5 volt buck to power the Pi and keyboard;
- A 12 volt supply with a 5 volt linear (LDO) regulator to power the Pi and keyboard;
- Two separate power supplies;
- Replace the 12 volt LED strip with a 5 volt version.
Because the Pi and keyboard require much less power, I might consider using a 12 volt supply and adding a buck regulator. It doesn't make sense to me to use a 5 volt supply but have to boost it to 12 volts for more than 80% of the load. DC-DC buck regulators can be found relatively inexpensively. As long as it is rated for ≥ 17.5 W and can accept 12 V input, it should work. (An LDO could also work, but for various reasons I'll dismiss that option.)
You could also use two separate power supplies. I realize that your question specifically states just one power supply, but there are dual-output supplies available (like a Meanwell RD-125A) which may be an easy or cost-effective option.
Finally, you could replace the LED strip with a 5 volt version, and no longer need to supply a second voltage. The determining factor would be based on time and cost (perhaps you've already mounted the LED strip in a way that's difficult or time consuming to change).