“Lullabies are very natural, but there’s not the perfect list of lullabies,” Dr. Collins said. “It’s about holding that child, looking them in the face, rocking them so they get the sense of the rhythm and the movement.”

Researchers have looked at the ways that infants respond to maternal singing. But in research studies comparing babies who were held and talked to or left in their cribs and sung to, she said, the babies went to sleep more quickly if they were sung to. “It’s about having that connection they feel when someone sings to them.”

Ms. Eagen recalled working with a mother who talked about the connection she felt to her baby when she saw the heart beating on the sonogram. “The doctor said, you’re the only one who will have this baby’s heart beat inside you, you’ll know each other’s heartbeat,” and that became the lullaby: I’m the only one who knows your heartbeat, and you’re the only one who knows my heartbeat.

For a family with a baby in the neonatal intensive care unit, “we wrote a song: ‘We’re waiting for you to come home, and we’ll celebrate with all the balloons in the world’ — we were all in tears,” she said. “It’s very transformative. You don’t know how much singing and writing a song is going to feel like you have agency — it really does make a difference to do this.”

Lullabies are important for the babies who hear them, but also for the parents who sing them, said Dr. Dennie Palmer Wolf, the principal researcher on the project, who put together research summaries on the importance of making music and on lullabies and wellness.

“Most of the mothers we worked with in New York live under very stressful conditions,” such as having a sick baby in the NICU or being homeless. “Restoring a sense of positive well-being is extremely important; unless parents have that to draw on, it’s hard to be consistent and emotionally available for their children.”