ported mostly
ported noise generator