Signals from a rapidly rotating, ultradense star have been transformed into beautiful melodies, revealing the "SOS" sounds of the star's dwindling companion.

This rapidly spinning neutron star, also known as a pulsar, emits beams of radiation from two hotspots on its surface. Located 6,500 light-years away, this pulsar (designated PSR B1957+20) has a cool, lightweight companion star called a brown dwarf.

Residing only 2 million kilometers away from the pulsar, the brown dwarf companion star is tidally locked to its mate, much like the moon is tidally locked to Earth. This means the same hemisphere of the brown dwarf always faces the pulsar. Because of its close proximity, the brown dwarf star is repeatedly blasted by the strong radiation coming from the pulsar. ['Black Widow' Star Consumes Cosmic Companion (Video)]

Pulsars in these types of binary systems are referred to as "black widow" pulsars, after the dangerous spiders that devour their mates, because the powerful blasts of radiation can ultimately consume the stars' cosmic companions.

As the pulsar blasts material off the surface of its companion, it also creates a "wake" or comet-like tail of gas around the brown dwarf. This, in turn, acts like a "magnifying glass," helping researchers see the pulsar up close by brightening its pulses, according to a recent study led by Robert Main, a researcher from the University of Toronto.

In fact, the pulsar's beam is made up to 40 times brighter as it passes through the brown dwarf's tail, according to the study, published in May 2018 in the journal Nature.

Using the Arecibo radio telescope in Puerto Rico, researchers were able to capture the pulsar's radio emission and convert it into sound. Their findings reveal that the pulsar generally hums a steady E-flat note (Eb), though there is an occasional "flicker" of sound created when the radio emissions are magnified as they pass through the brown dwarf's tail, a new animation shows.

"The percussive instruments are triggered by these magnification events, and the pitched sounds are created by shifting the pulsar's typical signal to different notes by speeding up or slowing down time," according to the animation.

Main worked with Matt Russo, a postdoctoral researcher at the Canadian Institute for Theoretical Astrophysics (CITA) in Toronto, to transform the signals from the black widow pulsar into beautiful song.

"The series of magnifications sound a little like Morse code, like the brown dwarf is trying to [signal] 'SOS,'" Russo told Space.com in an email.

To hear more harmonies of the cosmos, visit the System Sounds website.

Follow Samantha Mathewson @Sam_Ashley13. Follow us @Spacedotcom, Facebook and Google+. Original article on Space.com.