  Katsura associated a $C^*$-algebra $C^*_{A,B}$ to integral matrices $A\ge 0$
and $B$ of the same size, gave sufficient conditions on $(A,B)$ making it
simple purely infinite (SPI), and proved that any separable $C^*$-algebra
$KK$-isomorphic to a cone of an element $\xi\in KK(C(S^1)^n,C(S^1)^n)$ in
Kasparov's $KK$ is $KK$-isomorphic to an SPI $C^*_{A,B}$. Here we introduce,
for the data of a commutative ring $\ell$, matrices $A,B$ as above and $C$ of
the same size with coefficients in the group $\mathcal{U}(\ell)$ of invertible
elements, an $\ell$-algebra $\mathcal{O}_{A,B}^C$, the twisted Katsura algebra
of the triple $(A,B,C)$, show it is SPI whenever $\ell\supset\mathbb{Q}$ is a
field and $(A,B)$ satisfy Katsura conditions, and that any $\ell$-algebra which
is a cone of a map $\xi\in kk(\ell[t,t^{-1}]^n,\ell[t,t^{-1}]^n)$ in the
bivariant algebraic $K$-theory category $kk$ is $kk$-isomorphic to an SPI
$\mathcal{O}_{A,B}^C$. Twisted Katsura $\ell$-algebras are twisted Exel-Pardo
algebras $L(G,E,\phi_c)$ associated to a group $G$ acting on a graph $E$, and
$1$-cocycles $\phi:G\times E^1\to G$ and $c:G\times E^1\to \mathcal{U}(\ell)$.
We describe $L(G,E,\phi_c)$ by generators and relations, as a quotient of a
twisted semigroup algebra, as a twisted Steinberg algebra, as a corner skew
Laurent polynomial algebra, and as a universal localization of a tensor
algebra. We use each of these guises of $L(G,E,\phi_c)$ to study its
$K$-theoretic, regularity and simplicity properties. For example we show that
if $\ell\supset \mathbb{Q}$ is a field, $G$ and $E$ are countable and $E$ is
regular, then $L(G,E,\phi_c)$ is simple whenever the Exel-Pardo $C^*$-algebra
$C^*(G,E,\phi)$ is, and is SPI if in addition the Leavitt path algebra $L(E)$
is SPI.
