Carol Ryrie Brink is best known for Caddie Woodlawn, but she wrote a number of other books in a variety of children’s genres. Lad with a Whistle is her love-letter to Sir Walter Scott and Robert Louis Stevenson. It’s a shamelessly sentimental Scottish highlands adventure, featuring Rob McFarland: orphaned, homeless, and perfectly happy, earning his living as an itinerant piper. He befriends a pair of wealthy children who end up at the mercy of evil-doers, ultimately saving them with his bravery and resourcefulness. (Rob is an excellent example of the Boy With A Shepherd’s Pipe trope, exemplified by Dickon in The Secret Garden.)
Anyone familiar with Wolves of Willoughby Chase will immediately recognize that Joan Aiken had to have read this book. Two upper-class children (Annie & Malcolm/Bonnie & Sylvia) are helped by an older boy who lives by his wits out of doors (Rob/Simon). They are assisted by a faithful manservant (Geordie/James) and ultimately by an adult man (Tammas/Dr. Field) who brings in reinforcements. The villain is the housekeeper/governess (Mrs. Minnock/Miss Slighcarp), who is tall and severely dressed, aided by an evil lawyer (Mr. Dipple/Mr. Grimethorpe) and evil servant (Brody/Marl). They proceed to sell the family valuables, burn incriminating documents, and try to displace the children as heirs.
The children escape with the help of the boy, and spend a period of time wandering and camping out and becoming brown as “gypsies”/berries. They return to the manor house with the reinforcements, tricking the bad guys into incriminating themselves before the reinforcements leap out. There is a big feast for everyone after the bad guys are locked up, and a coincidental return of the lord of the manor (Sir John/Sir Willoughby) that evening. The boy turns down an offer to live at the manor, being too used to the simple life.
There are even a couple of elements that appear in the Wolves sequel, Blackhearts in Battersea: Rob carrying a stray kitten buttoned in his jacket, and a a painting being evidence of who is the real heir.