If the combination of Nicholas Sparks and Miley Cyrus sends shivers of horror down your spine, rest assured that they prove as dreadful a coupling as you can imagine. If you laid all the cliches in “The Last Song” end to end, they’d probably circle the globe several times over.

The script is described as the first that Sparks, the Fannie Hurst of our time, has adapted from his own novel, but the reality, it appears, was more complex: he was working on the screenplay for Cyrus, who wanted to move into dramatic roles, and simultaneously novelized it, with the book appearing before the movie. But whatever the order, his double involvement perhaps explains why the writing is so bad. The final product is like a compendium of his usual plot devices. There’s first love, naturally, the course of which does not run smooth, especially since one party is rich and the other poor. There’s parent-child antagonism. And there’s an untimely death to provide a teary finale.

How are all these threads sewn together? Well, Cyrus plays Ronnie Miller, a surly teen (and piano prodigy) who’s forced to spend the summer with her divorced father Steve (Greg Kinnear), her old keyboard teacher, at his Georgia beachfront home. But while her younger brother Jonah (ultra-cutesy Bobby Coleman) idolizes the old man—learning to help him build a stained-glass window for the local church that burned down under suspicious circumstances–Ronnie is utterly hostile to him. Do you suppose she’ll stay that way—or continue to refuse to play the piano again?

Then there’s the romance. Ronnie meets—cute, of course—handsome hunk Will Blakelee (Liam Hemsworth), a star of the local volleyball duo. Before long they’ve overcome their differences and are looking longingly into one another’s eyes, largely because Will proves his sensitivity by helping Ronnie save a nest of sea turtle eggs from a hungry raccoon. (I’m not making this up.) But their relationship is threatened by his snooty mother, his family’s past tragedy, and a secret he’s carrying about that fire, for which her father is widely blamed. The latter is also connected to a subplot involving Ronnie’s befriending of troubled girl Blaze (Carly Chaikin) who’s mixed up with a sleazy beach entertainer (Nick Lashaway)—who hits on Ronnie.

Cue the inevitable death watch, introduced by one of those sudden collapses that come out of nowhere. It wouldn’t be fair to reveal who abruptly—and literally—falls ill, but anybody remotely familiar with Sparks’ oeuvre will know well in advance what’s coming. The final reels of “The Last Song” are one long dirge leading to the funeral parlor.

This stuff would have been mawkish claptrap even in the most capable of hands, but here the execution is awful. Sparks’s dialogue is even worse than what other writers extracted from his books in previous adaptations, and Julie Anne Robinson’s flabby direction actually accentuates its lameness rather than tamping it down. Cyrus, alternating petulance with a laugh of joy that sounds utterly phony, delivers a performance that equals the quality of her work on the Disney Channel—which is to say it’s embarrassingly bad. Hemsworth is the sort of good-looking nonentity who might make it on one of the CW’s “young adult” soaps but is hopelessly out of his depth on the big screen, and Coleman, with his mugging and eye-rolling, is about on Nickelodeon level. That leaves Kinnear, who amazingly proves the subtlest actor around—a strange situation in which to find himself. But he’s stuck in a thankless part. And the supporting cast is incredibly broad, apparently invited by Robinson to go totally overboard. In fact, the best, most realistic performances come from the little sea turtles that hatch from Ronnie’s nest and the fish in the aquarium where Will works.

True, the locations are nice in “The Last Song,” and they’re well shot by John Lindley. But they’re hardly compensation for the things occurring in front of them. And the music is terrible, especially the pieces that Ronnie, the supposed prodigy picked for a scholarship by Juilliard, plays (and the ones Steve composes for her). They sound the elevator music usually designed to past for “serious” numbers in movies like this. Presumably Aaron Zigman, who’s responsible for the background score, is the culprit.

As music, they’re as phony as “The Last Song” is as a drama.