There had been major-label interest in his second album, and with it, studio sessions with big-name pop producers, he said. But Shamir hoped to move away from the carefree electronic disco revivalism that had become his signature, incorporating more of his personal, D.I.Y. rock tastes.

The compromise left no one fully happy, and although he had a multi-album deal with XL Recordings (Adele, Vampire Weekend), Shamir was dropped for not meeting creative expectations. The reset was freeing — “I don’t have a label, anymore, so who do I have to answer to?” — but terrifying.

Shamir considered quitting music before a marathon weekend recording session in his bedroom yielded “Hope,” a proudly messy 10-song project he released free on SoundCloud in April. “I wanted to do something reckless because I’d played by the rules and nothing worked out,” he said.