Ninth-graders at PTECH work on algebra problems in May.

On a muggy August afternoon last year, nearly 75 Bronx students could be found playing orchestra instruments to the tune of Duke Ellington’s C Jam Blues in the auditorium of M.S. 223.

They were gathered to mark the close of three weeks of arts, music, and math instruction they received through the school’s first summer “bridge” program. M.S. 223 is one of dozens of city middle and high schools to invite to incoming students for summer classes meant to immerse them in school culture and prevent them from forgetting what they learned the previous year.

“Summer bridge is important because we think of our model as a year-round school,” said Rashid Davis, principal of Brooklyn’s nascent Pathways in Technology Early College High School. “That way we’re not dealing with that summer learning loss than can go from two to four months of material, especially for high-poverty students. We can’t expect them to magically come in here with the skills they need.”

Indeed, researchers have pegged students’ regression — known as the “summer slide” — at the equivalent of two months of school or more. City officials recognize the challenge: This summer, the Department of Education is piloting a small program in the South Bronx for students who are struggling but not failing.

But the funding for that program, Summer Quest, comes from private donors. Public funds, for the most part, are earmarked only for the thousands of students across the city who are required to attend summer school because of low test scores or poor grades.

That means schools that develop programs for incoming students who aren’t already in trouble are on their own to scrounge up funding.

Principals say they turn to outside help or struggle to find wiggle room in their annual budgets to finance the programs, which range from three-day-long orientations to six-week intensive geometry classes. The school leaders say the programs are invaluable for students who can make it, but most can’t afford to run a program large enough for every student to participate.

Prioritizing optional summer programming usually means cutting corners elsewhere.

“We absolutely have to make tradeoffs because there is no unique funding that comes in for summer bridge,” Davis said. “You have to decide to make that type of investment. [Tradeoffs] could be with supplies, or it could be half a person’s salary, it really depends.”

Davis has strongly encouraged PTECH’s rising ninth- and 10th-graders to enroll in a six-week geometry course starting this month. As the new school grows to its full size, Davis said he would like to offer six weeks of summer enrichment classes or college-level courses to every student. He also wants to give every incoming ninth-grader the chance to pass geometry before he or she even begin high school, thereby eliminating one hurdle on the course toward calculus.

Those plans will cost him. This summer’s program will cost about $30,000 in teacher wages and classroom materials for the 200 students, he said. Those funds come out of the school’s total budget of $1,005,000.

Davis said he is used to the budget wrangling. As principal of Bronx Engineering and Technology Academy, he sometimes had to pull funding from his school-year budget to pay for classes for students who were mandated to attend summer school. The city allocates funding to each school for summer remediation, but the budgets are based on estimates made before students take their final exams.

Sana Nasser, the principal of Harry S. Truman High School in the Bronx, said she usually has no money left over after meeting the needs of students who are required to attend summer school to fund enrichment. But she is still able to run a small bridge program for a quarter of her incoming students with the help of the community-based organization Sports and Arts.

Sports and Arts pays for four of Truman’s teachers to run the program, which Nasser estimates would cost about $35,000 if she funded it from the school’s budget.

“I have not been able to pay for it with the DOE funds. I couldn’t do it financially,” she said. “Yet it is so valuable. We give them teachers that we feel are very nurturing but also know how to set rules and boundaries, because that’s really what they’re going to face in September.”

Nasser sends each of her 600 incoming students a letter inviting them to attend the summer program, which will run July 19 to August 19, but can only accomodate about 150. If more than that number apply, she selects the students with the lowest test scores and attendance rates.

Nasser said she would prefer for the program to benefit everyone.

“We find those kids that come in, they’re transition when they come in in September is a much better adjustment,” she said. “We take them on tours. We teach them how to negotiate the building, the elevators, the gyms, lunch. And they get to know the teachers. They’re coming in with the leverage of having someone they can go to — and the kids need that.”

Philip Weinberg, principal of Brooklyn’s High School of Telecommunication Arts and Technology, another large high school, offers 12 days of summer enrichment classes and an orientation for ninth-graders. But only the first 112 students who sign up out of his incoming class of roughly 350 are allowed to attend.

He estimates that the 60 hour-long program led by four teachers will cost his school at least $10,000 this year.

“It’s definitely a budget hit,” Weinberg said.”It’s a game of priorities. We have made the decision that offering even one third of the class an opportunity to acculturate to the building is worthwhile.”

Students who make the cut will receive math and English lessons designed to close the gaps between what they learned in eighth grade and what they will need to know for the first weeks of high school. The students also get to meet school administrators and explore the school’s Gothic-style building in Bay Ridge, Brooklyn.

“One of the first projects they do in math is measure the school,” Weinberg said. “It causes them to go all over the building, so the first day in September, one out of three kids in every ninth grade class will know where the next room is. We want to alleviate a lot of that fear of the unknown.”