Wherever he goes and whatever he may be doing, Pharrell Williams can’t help calling attention to himself. At the start of a typical week in early December, this musician and producer was modeling in a Chanel show in Paris. By Thursday evening, he was in New York, talking to Jimmy Fallon on “The Tonight Show” and performing “I See a Victory,” one of his new songs from the film “Hidden Figures,” with the gospel singer Kim Burrell.

That Friday morning, he and Ms. Burrell were playing that song on the “Today” show, and that afternoon, he was stretched across the couch of a suite at a luxury hotel in Midtown Manhattan.

But by the end of this itinerary, Mr. Williams was looking to shine the spotlight on “Hidden Figures”: The film, directed by Theodore Melfi, tells the story of the real-life mathematicians Katherine Johnson (played by Taraji P. Henson), Dorothy Vaughan (Octavia Spencer) and Mary Jackson (Janelle Monáe), black women who worked at NASA during the space race of the 1960s, a period of racial segregation and open bias.

“Hidden Figures” is a story of representation that Mr. Williams cares about profoundly, and he has been deeply involved in the project. In addition to writing and performing new songs for its soundtrack, he is a composer of its score (with Hans Zimmer and Benjamin Wallfisch) and is also a producer of the film.