JavaScript (V8), 150150 95 bytes
-55 thanks to @dana
f=x=>{s="";xx=>[.split``.map.[...x].reduce(c=>{b=c(a,c)=>a+c.charCodeAt(0).toString(2);s+="0".repeatpadStart(7-b.length,0)+b},"");s=s.split``].map(c=>x!=(c,ix=c)=>i>0?c!=s[i-1]?1:0:1|0).join``;return s;}
Kind of embarrassingly long, but anyway. Would appreciate help with shortening some of the arrow functions - for some reason, currying didn't want to work.Try it online!