Good answers already by λyoye d'oncques and None, but I thought some extra pedantry might be helpful. That said, I don't think you should focus on the correct translation, but rather on capturing the correct image or sense of what the author is saying. We'll use a bit of literalist half-translation to try to clarify that, but an actual translation (for someone who hasn't read the passage in the original) is secondary.
Les fusils-mitrailleurs n'avaient presque pas cessé de crépiter depuis le matin, et il s'y mêlait aussi des coups de fusil isolés.
First let's understand what's literally happening in the sentence, to understand what is being said rather than worrying about the words--again, elegant translation isn't the goal; the goal is to understand French.
The first part is pretty straightforward; "The machine-guns had almost not ceased to crackle since the morning"--the image is the continuous production of discrete, sharp, fairly high-pitched noises. I can't find the source context, but I'm getting a WWI trench-type situation (though without the deep explosions of heavy artillery), or somebody being under siege.
Then we get the second part:
et il s'y mêlait aussi des coups de fusil isolés.
Here there's some grammar with no exact English correspondences.
First, a minor point: des coups de fusil isolés--it's tempting for an English speaker to associate isolés with fusil because we like to put our adjectives close to their referents. But French grammar helps you out here: isolés and fusil do not agree in number. So isolés is modifying coups de fusil, not the guns themselves. Noting the military context, the fusils are likely "rifles" rather than "guns" generically. Also "isolated" would probably be a false friend here, especially since it's describing the sound, not the rifles or the people using them; so let's call this "distinct rifle reports"--sense 5 for the last one.
Now we get to the meat of your question, et il s'y mêlait aussi.
y is a single-word pronoun for a prepositional phrase. It's always à + NOUN (or au + NOUN, as appropriate). There isn't really a good single-word equivalent for this in contemporary English; one can use "thereto" I suppose... Also note, French à doesn't always map perfectly to exactly one preposition: the English equivalent could be "at" (à ce moment-là), "to" (à la plage), or even just a possessive s (c'est à elle "it's hers" or "it belongs to her"). But that's for English speakers or literary translators to worry about; you just need to associate à with "towardness" or "entering" (as opposed to de which is "awayness" or "coming from").
se mêler: both the definition and, even better, the examples, show that mêler is a transitive verb meaning roughly "to mix". (Let's not fuss over the exact equivalent; even between very closely related languages, the clusters of meaning may not correspond exactly.) French transitive verbs tend to be more insistent about having an explicit direct object than English verbs are. So while in English you'd say "the colors mix"--and we understand implicitly that they are also receiving the action of mixing, they aren't stirring pancake batter--in French it's les couleurs se mêlent, they "mix themselves," so the direct object is still explicit. The same source also says that se mêler à uses à to show what's being mixed into.
il serves the same function here as in il y a or il pleut: it's a dummy noun. Here it's occupying the subject spot of the sentence, and will be clarified later on, just as in some dialects of spoken English one might say "It hurts, your shoulder?" The il would not appear in standard English translations of the source sentence.
So overall this is chunk is "and thereto admixed also the distinct reports of rifles"--which is terrible English, at best rather archaic, so let's stick with the French: il s'y mêlait aussi des coups de fusil isolés = des coups de fusil isolés s'y mêlait aussi = des coups de fusil isolés se mêlait aussi [à qqch], with the qqch in question being the continuous noise of the machine guns. Which is not a word that's ever explicitly stated: it's just clear from context, and a nice thing about having a pronoun for an entire prepositional phrase is that you don't have to spell it out. Stressing the image again: there is a fairly continuous or constant noise of regular machine-gun fire, but mixed in with it the listener can also hear the distinct, probably less rhythmic/regular, sounds of other guns firing, which makes them stand out individually.
Question: if il s'y mêlait aussi des coups de fusil isolés is semantically equivalent to des coups de fusil isolés s'y mêlait aussi, why the il? Answer: emphasis. I am not a native speaker, but my understanding of this sentence is that putting des coups de fusil isolés at the end of the sentence places it in a more prominent or more emphasized position; it gives it more attention. French prosody--with phrase-final word stress, rather than fixed word stress like we have in English--would also support this. (One could even make a literary-critical argument that this emphasis makes the words stand out, just like the individual rifle-shots being described--but that's maybe a little cute.)
So to be as literal as possible, I suppose "The machine guns had barely ceased crackling since the morning, and therein mixed also the distinct reports of rifles." For literary translation, anything that captures this image will work; that's between you and your conscience (or maybe your editor). Depending on mood and audience, I would go with anything from "The machine guns had hardly ceased crackling since the morning, and into the din was mixed as well the discrete reports of rifles" to "The machine guns had barely stopped firing all morning, and the sporadic sounds of rifle fire seeped in with their crackle" to "The crackle of the machine guns, ceaseless since the morning, was punctuated irregularly by distinct rifle-pops" but that's secondary; what matters is the image, and understanding the French.