Welcome to the forum.
Look in the Equipment Tips sticky for posts in the section "INTERFACING OUTBOARD GEAR". The posts there should get you pointed in the right direction for hooking up outboard gear like drum machines and keyboards. The first post has an index to the sticky posts.
Drum machines and keyboards interface like any other outboard gear. MIDI is only needed if you want the Porta-studio to control the drum machine or the keboard.
If MIDI is how you need to go, Phil Tipping's video #13 (also found in the forum's Sticky section) demonstrates a way to use MIDI with a DP-24/32 SD. (While Phil's videos are free, a donation to him for his hard work is always appreciated.)