Sending and receiving Manchester biphase to directly control pins

Alright, so my project is a bit unusual, but what I need to do is:

  1. Take input from 5 pishbuttons and feed it into the Arduino and turn it into Manchester biphase code

  2. Send this Manchester code to a cassette recorder

  3. Playback the Manchester code into another Arduino and turn it back into individual pin control

So, my actual question is "how do I take pushbutton input from an Arduno, turn this into Manchester biphase, send it into a cassette recorder, output into another arduino and decode it back into individual outputs?"

Encoding and decoding strings seems somewhat simple, but I have seen 0 projects that do anything similar to what I want to do.

Before worrying about Manchester biphase, you have to decide on a message structure and communications protocol.

To begin with you might write a little program that reads the buttons, and when the status of any button changes, sends a short message to the serial monitor.

The message could be two characters, for example. "41" means button 4 was pushed on, "40" means button 4 was released.

When that works, you modify the program to send the Manchester bit stream for those two characters somewhere else. You'll probably need "start of record" and "end of record" identifiers. Obviously, if you want to record and faithfully play back, some sort of message time marker will be needed.

You might look into how MIDI messages are constructed, for example MIDI Messages