Canonical bundle of blow up at singular point Let $X$ be a complex variety/ manifold with one singular point $x_0\in X$. If we blow up $X$ at $x_0$, we obtain a smoot variety/manifold with exceptional divisor $Y$. How can we calculate the canonical line bundle $\omega_{\tilde X}$ of $\tilde X:=Bl_{x_0}X$?

If $X$ was smooth, then the calculation of $\omega_{\tilde X}$ is done in severalsteps:


*

*We know that the blow down map $\pi:\tilde X\to X$ when restricted to $\tilde X\setminus Y$ is an isomorphism with image $X\setminus x_0$. Hence $\omega_{\tilde X}=\pi^* \omega_X \otimes \mathcal O_{\tilde X}(Y)^{\otimes a}$ for some $a\in \mathbb Z$.

*Adjunction for $i:Y\hookrightarrow \tilde X$ implies $\omega_Y=i^*\omega_{\tilde X} \otimes N_{Y/\tilde X}$

*Using that $Y=\mathbb P^{n-1}$ and inserting the first equation in the second one we get
$$\mathcal O_Y(-n)= i^* \pi^* \omega_X \otimes \mathcal O_Y(Y)^{\otimes a+1} $$ 

*Since $\pi\circ i$ is constant and the normal bundle $\mathcal O_Y(Y)=\mathcal O_Y(-1)$, this implies $n=a+1$. Hence 
$$\omega_{\tilde X}=\pi^* \omega_X \otimes \mathcal O_{\tilde X}(Y)^{\otimes n-1} $$

But how can I generalise this argument for the case of $x_0$ being a singular point?
One thing to change is, that the normal bundle might not be $\mathcal O_Y(-1)$ anymore, but this is no problem.
What bothers me more is the ansatz $$\omega_{\tilde X}=\pi^* \omega_X \otimes \mathcal O_{\tilde X}(Y)^{\otimes a}.$$
Can we even write this down? Is the canonical bundle $\omega_X$ well-defined? Can we instead work with $\omega_{X\setminus x_0}$. (But then the pullback by $\pi$ is not a bundle on $\tilde X$). And if there is a line bundle $L$ on $X$ such that $\omega_{\tilde X}=\pi^* L \otimes \mathcal O_{\tilde X}(Y)^{\otimes a}$, how do we need to modify the rest of the argument?
Update: In the comments it was pointed out, that singular varieties still have a canonical sheaf. Does the proof above generalise simply by replacing canonical bundle with canonical sheaf?
 A: First, a note about the "canonical bundle" $\omega_X$ you refer to: schemes need not have $\omega_X$ be a line bundle, nor even a sheaf all the time (in general, it's a complex of sheaves living in a derived category). So knowing that some scheme has a canonical bundle is already something - it means that $X$ is Gorenstein (and correspondingly, knowing that it's a sheaf means that the scheme is Cohen-Macaulay). Many/most schemes you will encounter in the wild have dualizing complexes, and they're perfectly well-defined. (I'm hedging a little on the language here because I've never encountered a scheme without a dualizing complex but I don't have a reference which details any known classes of schemes without dualizing complexes. Maybe this is grounds for another question!)
Another related issue is that it may happen that $f^*(\omega_X)|_{X^{sm}}$ does not extend to a line bundle on the whole of $\widetilde{X}$ - even when the singularities of $X$ are on their best behavior, one may need to consider some power of $\omega_X$. 
Now for specific answers about your query about $\omega_{\widetilde{X}} = \pi^*\omega_X \otimes \mathcal{O}_{\widetilde{X}}(Y)^{\otimes a}$. Suppose $X$ is a normal variety with $\Bbb Q$-Cartier canonical class $K_X$. If $f:\widetilde{X} \to X$ is a resolution of singularities, we then have that $K_{\widetilde{X}} = f^*K_X + \sum a_iE_i$ where $K$ is the canonical divisor, the $E_i$ are the exceptional divisors, and $a_i$ are rational numbers (known as discrepancies). This is essentially equivalent to the ansatz you've listed above: a suitably-defined resolution of singularities is an isomorphism on the smooth locus, so all you would need to adjust by in order to get the canonical class of the resolution is something to do with the exceptional divisors.
If you're interested in a specific singularity, you'll need to get your hands dirty at this point in order to compute what the $a_i$ are. One obstacle here is that there are often many different sequences of blowups that one can take in order to produce a resolution of singularities, and they can produce different sets of $a_i$ - typically, singularities are classified by how these $a_i$ fit into different boundary regions: terminal/canonical/log-terminal/log-canonical/non-log-canonical depending on whether all $a_i$ are $>0$, $\geq 0$, $>-1$, $\geq -1$, or some $a_i < -1$. These classifications persist across all possible resolutions of singularities.
