My question involves criminal law for the state of: New York

So the other day I was (allegedly) speeding in a 55mph zone and was pulled over. The officer approached my window and asked for my license and registration, so I rolled down my window to give them to him, at which point he asked me "can you explain to me why there is marijuana in your window?" - I guess some crumbs (of something that at least resembled marijuana) somehow ended up in the rubber seal lining the window. So then he asks me if there are any other drugs in the car blah blah blah - he ends up searching the car, finds some other stuff.

So this ends with me in the back of a police car, not in handcuffs, never being told I'm under arrest or having my rights read to me, we drive like 40 minutes to the police station and he's asking me questions, some of which I answer, some that I don't. At the station he takes my info, fingerprints, photos, has me call someone to pick me up and has me sign a couple things, then gives me 4 appearance tickets for court, 2 misdemeanors for criminal possession (1 for a med i'm prescribed but wasn't carrying in the OG container, another for residual amounts of THC concentrate), 1 violation for unlawful possession, and 1 for a violation of Public Health Law.

Should I have been read my Miranda rights? At least before or as I got into his car... right? I was not handcuffed OR explicitly told I was under arrest, but I also wasn't free to go so I'm assuming my rights should have been read to me at some point?