From one corner, where children are taking part in free music workshops, the smooth but chirpy notes of a saxophone pick out theme tunes from The Simpsons and The Pink Panther.
In another tent, children are in a huddle, eyes open wide in awe as they listen to Michael Kerins, the storyteller of the day.
In the distance, cries of "Come on, Mum!" ring out as children pull their parents by the hand to an event in the main theatre. The author they are so eager to see is Michael Morpurgo. His packed audience contains lots of adults who are there not just to accompany their children but because they also want to get involved. When the audience is invited to ask questions, there are plenty of older hands among the wilder young ones prodding the air.
At a smaller, more intimate, session earlier in the day, audience participation was just as evident. From grandparents to youngsters, they all joined in author Elizabeth Laird's game of Chinese whispers (to prove how stories change over time as they are passed from person to person) and were keen to compliment her on her latest novel, Secrets of the Fearless, at the end of the session.
This family participation is exactly what Karen Mountney, director of the book festival's children's programme, is keen to see. "I've tried to get more events for young families to share so that the entire family can come here together," she explains.
"There are also more free events so that families can come for a whole day.
We are hoping to get the message to people that it's a festival for the entire family."
Judging by the numbers filling the square at the weekend, this message is certainly getting across. There is something for everyone, from events for babies, to sessions on how to be a poet, to an event on how to understand that most curious thing, the teenage brain. There are also events for adults about children and reading, with a new addition to the festival programme, a whole day drop-in session, which proved to be successful.
"We had a reading makeover for parents," Ms Mountney explains, "a whole day with the co-ordinators of Read Together (the Scottish Executive's home reading initiative) in residence. It's sometimes hard for parents and teachers to know what's 'in' in the playground."
One collection of stories known to be in favour is the Horrible Histories series. On Sunday, children poured in to see illustrator Martin Brown divulge secrets about how he concocts his ideas for the books.
After explaining how the ideas of writer Terry Deary get from his brain cells to the bookstore, he delighted his audience by dressing up in Tudor style - a white shift, beige doublet with black sleeves and woollen bonnet - and then ran around with a blown-up pteranadon, a large-winged dinosaur with a head like a pelican.
Brown was in for a surprise himself when he asked for ideas for four faces he had drawn on the flip-chart at the front of the room. The suggestions included a carrot for a nose, strawberries for eyes and spaghetti for hair.
"I was thinking more of descriptions like long, short, pointy, but there you go," he said.
All of this creativity and imagination is testament to what the book festival is all about.
"It's about creating, listening, talking I everything," says Ms Mountney.
"It's the imaginative journeys that are in books as well as the books themselves."