Just a note for warlock:
Those magic 10 are contained in the global MAX_POWER_PER_EMBER.
Code:
UnitPower("player", SPELL_POWER_BURNING_EMBERS)
is the same as
Code:
math.floor(UnitPower("player", SPELL_POWER_BURNING_EMBERS, true) / MAX_POWER_PER_EMBER)
The same goes for
UnitPowerMax. As you only want a sound on gaining a full ember and use the first, just skip the POWER_DIVISOR code at all. It also does not make much sense for demonology either, as the abilities you use in metamorphosis have different demonic fury cost and the spells when not in metamorphosis generate different amounts of it too, so that your play style does not depend on demonic fury being gained in chunks of a set amount. You can also spend less than full embers with the T15 2-pieces bonus when Dark Soul is active, which would make your sound based implementation sub-optimal in the this scenario.