If you read music, check out MuseScore 2 (
https://musescore.org/en/download)
Technically, it's notation software. But it has extensive MIDI capabilities. It does loop playback, and also observes things like repeat signs. I used Finale for 20 years, but MuseScore has really matured into a top-notch contender. I find it more stable on Mac, with a better user interface.
MuseScore FOSS. It's a community-supported open-source project, free as in speech
and beer. You can obtain it without worry from the URL above
For free workstation software, I would recommend Reaper. It's a full DAW, but has a nice MIDI sequencer with both event and piano roll editing. It's technically a commercial product. However, the evaluation version isn't crippled (you can still record as much as you want and save stuff). It'll just ask you to buy a license every so often. The non-commercial license is only $60, so if you decide it's worth buying, it's relatively inexpensive.
Another option is Ableton Live Lite. I love Ableton. Its sequencer is very performance-oriented; you can create MIDI clips and launch them in a specific order ("arrangement), or take over and play them live. Ableton, too, is a commercial product, but you'll get Live Lite for free with a lot of products (for example, if you pick up a Novation Launch Control for $60, you'll have both Ableton and a nice interface to launch your clips). The only real limitation is that Live Lite allows only 8 tracks.