A code to calculate supernova rates etc. based on an input IMF