I believe he actually did a small pact with a unknown demon he thought it’s the devil.
One night, in the year 1713 I dreamed I had made a pact with the devil for my soul. Everything went as I wished: my new servant anticipated my every desire. Among other things, I gave him my violin to see if he could play. How great was my astonishment on hearing a sonata so wonderful and so beautiful, played with such great art and intelligence, as I had never even conceived in my boldest flights of fantasy. I felt enraptured, transported, enchanted: my breath failed me, and I awoke. I immediately grasped my violin in order to retain, in part at least, the impression of my dream. In vain! The music which I at this time composed is indeed the best that I ever wrote, and I still call it the “Devil’s Trill”, but the difference between it and that which so moved me is so great that I would have destroyed my instrument and have said farewell to music forever if it had been possible for me to live without the enjoyment it affords me.
Mesmerized by the devil’s brilliant and awe-inspiring playing, Tartini attempted to recreate what he had heard.
Tartini lived in the times where the “Deal with the Devil” motif was popular in European Folklore. Maybe he just had a random dream… BUT this “purely psychological experience” still counts as a demonic contact because he succeeded in composing that masterpiece the demon showed him.
As a long time guitarist ( 32 years and counting ) that writes and plays a mixture of black metal/death metal/classical music/horror movie sound track, as well as having played in several bands ( some of which black metal/death metal fans may have heard of, and toured with some that metal heads have surely heard of, and all bands I’ve been in got payed to play ), I think the Sonata you mention is called the “Devil’s Trill” because it makes extensive use of what was called “the devil’s interval” or the Diabolas In Musica. The real name of the interval is called a tri-tone, because it’s composed of 3 whole steps ( or tones ). You can write some really evil sounding music by employing that tri-tone interval at the right times, especially when used in conjunction with certain scales ( or modes, if you prefer ). I use it often, usually with the Harmonic Minor ( or any minor scale really ), Dorian, Phrygian, Mixolidian, and more. Octaves are good to use with it, as well as Minor Thirds, and Root Fifths ( Root 5ths are your basic “power chords” in structure, but sound way cooler when the root is played by 1 guitarist and the 5th by another, as there is so much more you can do with 2 guitar players ). It also sound cool when playing/writing a song with what I call “Obituary chords”, since the band Obituary uses them a lot ( it’s basically 2 adjacent strings played on the same fret and the next string up played a whole step ( 2 frets ) higher, simultaneously. That’s just a musician’s theory, so take it for what you will