Arduino+PT2313

Hi!
I started a circuit months ago, but I couldn't finish it yet. I wrote a sketch, but maybe I took mistakes in it even though the IDE saw it good. I saw other similar projects for example this but I couldn't figure out how it works at all. I need IR remote control and a rotary encoder to control this preamp. Can you guys give me a little help?

pt2313.ino (3.81 KB)