One of the supplements for 2e was a campaign setting(?) called "Red Steel", and it was a sorta musketeers-like setting with red steel, red stuff which gave people mutations and red powder which was gunpower all interlinked into the setting. It seemed like a fun idea.
I could easily see gunpowder being an alchemical product.
Of course you do realize that with magic and firearms existing side by side, warfare might not completely resemble warfare of the 18th and 19th centuries.
Yes, gunpowder could evolve as rapidly as it did in China.Kobold Avenger, problem is, things are *never* static. Once you have the tech for those...it will evolve as other techs improve.
Realistically, the thing that gunpowder did was make it a lot easier for untrained peasants to easilly be formed into militias. A gun is point and shoot--it takes practice but no where near the same amount of training it took to use a longbow, a lance, a crossbow, etc--or in a fantasy setting anyone who uses magic.
Kobold Avenger,
problem is, things are *never* static.
Once you have the tech for those...it will evolve as other techs improve.
A rifled barrel percussion rifle is very accurate, note the buffalo guns.

(Dungeons & Dragons)
Rulebook featuring "high magic" options, including a host of new spells.