The still Hudson Valley air is cut by a mustachioed-security guard’s ring tone — “Bad boys, bad boys, whatcha gonna do when they come for you?” — as he rushes inside to complain that he “wasn’t told” visitors would be coming.

If they weren’t registered with the Department of State, “they’re not coming in!”

Nervous p.r. reps laugh off the awkwardness as an example of the ultratight, state-of-the-art security in place at New York’s “best” legal medical marijuana grow center — the company whose business plan was given the highest score by Gov. Cuomo in 2015, when he awarded five coveted licenses to grow and distribute medical marijuana.

“We’ve been here a million times and even we can’t get in!” one p.r. rep joked of the facility’s security.

And all the action takes place in a building as sedate as it gets.

There are no hippies in grungy-dreads, no Bob Marley music, not even a single pot-leaf symbol at the Hamptonburgh hilltop on which PharmaCannis built its cultivation center.

An NYPD-cop-turned-security guard emerges with white visitor tags, holds open the door — and suddenly, that unmistakable odor reminiscent of a college dorm room slaps you in the face.

We’re in.

PharmaCannis broke ground at the end of 2015, shortly after Cuomo granted its license under the state’s Compassionate Care Act.

The massive facility opened in July, and by law, can’t even post a sign stating what goes on inside. The only signage — a piece of typing paper with the words “PharmaCannis Deliveries” printed on it — is taped to the front door for the benefit of flummoxed mail carriers.

Just getting started in this business is a tricky feat.

Even after getting the nervous blessing of the governor, a grow facility must begin by procuring a seed — a Kafkaesque task, since transporting a seed into the state of New York violates federal controlled-substances law.

“We call it the original seed conundrum,” Jeremy Unruh, PharmaCannis’ chief compliance officer, says from a sprawling, circular conference table in a dimly lit section of the spacious grow house.

“We like to say the stork brought the plants . . . and let’s just say that stork looks amazingly like a FedEx delivery driver,” Unruh joked.

For now, they are keeping the operation small. The grow center is running at just a fraction of its full capacity, despite having four dispensaries across the state.

In Cuomo’s medical-marijuana kingdom, security takes top priority, next to quality. Vendors like PharmaCannis, which has invested at least $30 million into its 130,000-square-foot facility, are not taking any shortcuts.

The security room is their “control center.”

Dozens of bright, blinking screens show rotating views of each corner of the facility. A running feed of every person coming and going and a log of the rooms they’re entering is displayed in real time.

There’s 24/7 surveillance of every entrance, exit and door, and anywhere cannabis is stored, processed or grown. Close to 400 cameras cover the facility.

Surveillance is just one part of the “three-legged stool” making up PharmaCannis’ security protocol. Access control is another prong — only certain people can enter certain rooms.

A white piece of paper is taped in every room at the facility showing two lists of names: those that can enter by themselves and those that can’t.

A musty, white greenhouse connects from the main building and opens to a wide, brightly lit corridor that leads to the grow rooms. The air is warm and damp and feels more like Florida in the summertime than an upstate New York office building/grow house.

Enter the “mother room,” or the propagation room, the place where all the plants are born.

Little pots hold hundreds of miniature marijuana plants with their emblematic, seven-pronged leaves sticking out from tiny roots. These are all clones from massive mother trees that tower behind them in a miniature indoor forest.

The cultivation manager, Brendon Hershey, explains that everything, from the lighting to the humidity, is automated.

“We have over 10,000 plants and we have five people, so each person gets 2,000 plants . . . We couldn’t handle this without automation,” Hershey said, wearing dark sunglasses to block out the ultrabright lights that blanket the room.

“A lot of these facilities out West will have 2,000 plants only.”

Hershey, who has “zero cannabis experience,” used to work for DuPont Pioneer, a national seed producer for farmers.

Unruh explained it is important to mix “mainstream people” with those who have “former black-market experience” with pot plants.

“There’s a science and an art to it; you gotta have both,” he said.

The greenhouse has seven other rooms, housing the plants at their various life stages, with automated heat lamps that mimic natural light cycles. The rooms are a sunny, vivid yellow that make you squint and start to hurt your eyes if you say too long.

The plants need to be touched only three more times before they’re harvested; everything else is completely mechanical.

“This thing’s a giant machine, so we did all of the leg work to set up the machine and now it’s just running,” Hershey said proudly.

“There’s a science and an art to it; you gotta have both.”

Louis Mejias, a Big Pharma transplant and lab nerd, is the genius behind PharmaCannis’ extraction process — the science that turns smelly, green buds into the medicine that’s helping some of New York’s sickest residents.

“I transitioned my career into medical cannabis because I believe in the science. It’s a natural product made from a natural process in a highly secure and regulated way,” Mejias told The Post.

After 16 weeks, plants are harvested and dried.

They’re ground up in an industrial “hammer mill” — the same thing that turns garlic into garlic powder — before they are ready to become pills, oils or tinctures, the three forms of medical marijuana allowed in New York.

The mill can grind about 800 plants per day. It is then processed through a $100,000 piece of equipment that uses carbon dioxide to extract the medical parts of the plants.

“It’s basically pouring liquid through the marijuana and collecting the marijuana water,” Mejias explained in laymen’s terms.

What comes out is a “slug” with a “multitude of colors, from brown, to a really pale yellow to everything in between.”

The contents, enough to fill an average-sized cake pan, are worth more than $50,000.

The lumpy mass is then “homogenized” in ethanol and refrozen in a process called “winterization.”

It is then fed into a complicated series of tubes, beakers and flasks. The setup, used for “decarboxylation,” is so special, The Post wasn’t even allowed to photograph it. “It’s the only one in the world like it,” Mejias said with a smile.

The entire facility runs like a lab operated by scientists like Mejias who have decades of experience in the pharmaceutical industry.

There are white lab coats, gloves, steel equipment. If you didn’t’ know better, you’d think they were making aspirin or ibuprofen.

It’s light years from the hippy, mom-and-pop grow centers dotting the West Coast, and while everything is nice and shiny on the outside, the story isn’t as perfect as it seems.

The facility is running at only about 5 percent to 7 percent of its capacity and remains mostly empty, a mere husk of its full potential.

Voices echo throughout, and the barren rooms can’t help but feel lonely. There’s an entire greenhouse with no greens, wasting away until more patients become customers.

Boxes of supplies collect dust in the inventory room, ready to go when called.

“We can easily handle all the patients in New York state right now and for the foreseeable future . . . but there’s not enough patients,” Unruh griped.

The Department of Health recently announced it will consider allowing patients with chronic pain to receive medical marijuana, which will add to the customer base, but officials also want to add five more companies to the list of growers.

“For the state to manipulate growing capacity before the market can sustain itself would be a devastating blow to a burgeoning program,” Unruh said.

“Authorizing additional registered organizations at this time makes absolutely no economic sense and will hurt patients who are already struggling within a delicate new marketplace.”