Please help me understand this scheme


I've recently started playing around with Arduino. I've got quite much experience with programming, but I'm a beginner regarding electronics.

I recently stumbled across this schematic: and I just don't understand why this works. I think I understand what happens when only one output is high at the same time (how the voltage is divided between the resistors and why the voltage at out is like it is). But I can't explain what's going on with two or more outputs high. Please give me some advice what's happening in this case.

Thanks in advance HerrHagen

Have a read through this then come back if still confused :)

-- Beat707: MIDI drum machine / sequencer / groove-box for Arduino