David Gilmour can’t just sit down and write a song. “Little bits come to me in strange moments,” the former Pink Floyd guitarist told the Journal recently from London. “When I’ve gotten the basis for something that I think has a little bit of magic, then I’ll work on something more constructed.”

Those bits of magic have come forth in the form of his fourth solo album “Rattle That Lock,” out on Sept. 18. Over the course of 10 tracks, Gilmour explores the thoughts a person has throughout a typical day, caused by personal and...