Why were some guns such as the Thompson submachine gun nicknamed 'chicago piano'?
Solution 1:
According to OED (paywalled), 'Chicago piano' has provided a slang name for two guns:
a. (a) British Navy an anti-aircraft gun on a ship; (b) a Thompson sub-machine gun.
The subordinating entry, sense 3 of "Chicago, n.", suggests a rationale for the slang use of 'Chicago' more generally; OED also records pairing of 'Chicago' in this slang sense with b. 'overcoat' and c. 'typewriter'.
3. slang. As a modifier, with euphemistic or humorous reference to the reputed violence and lawlessness of Chicago during the Prohibition era (1920–33). Now chiefly historical.
The overarching defining sense emphasizes the historical aspect of why 'Chicago' was paired with 'piano' as a nickname for the guns, as well as with 'overcoat' as a nickname for coffins, and again with 'typewriter' as a nickname for the Thompson submachine gun. The overall sense does not, however, afford us a specific explanation of why 'piano', or 'overcoat', or 'typewriter', would have been paired with 'Chicago' in the slang sense.
In the case of 'Chicago piano', one of the attestations given by OED does offer an anecdotal explanation for at least the use with reference to the Thompson:
1943 Washington Post 31 Oct. 2 b/7 You don't fire on this gun [sc. a tommy gun]... You play on it. That's why it's called the Chicago piano. You have to have rhythm.
The earlier British use of 'Chicago piano' in the sense of "an anti-aircraft gun on a ship", also called a 'pompom', attested from 1936,
…the name sailors of the British Royal Navy have given their new multibarrelled antiaircraft guns, "Chicago pianos".
St. Louis Globe-Democrat, St. Louis, Missouri, 09 May 1936, p. 14 (paywalled).
may have contributed to later application of 'Chicago piano' to Thompson submachine guns, attested from 1941 (1943 in OED):
It took three clips from the "Chicago piano" to mow Teddy [an elephant, ed.] down.
Daily News, New York, 20 Oct 1941, p. 23 (paywalled).
Use of 'Chicago piano' in the sense of "multibarrelled antiaircraft gun", the pompom, continued for decades.
Evidence from 1938 shows a conceptual link between the pompom and the submachine gun:
Only a week or two ago, the British Admiralty was proudly demonstrating to King George its new eight-barreled anti-aircraft guns, "Chicago pianos,"…named, forsooth, after the sawed-off shotguns and the "Tommy-guns" of Chicago's ex-gansters.
St. Louis Post-Dispatch, Missouri, 08 Jul 1938, p. 16 (paywalled).
Other than the historical "reference to the reputed violence and lawlessness of Chicago during the Prohibition era (1920–33)" (OED), an obvious reason the pompom was called the 'Chicago piano' was its appearance:
From Dam Neck to Okinawa, Robert F. Wallace, 2001.
He's in the sub-busters now, A. D. Rathbone, 1943.
The sources I consulted also mentioned, as supposed reasons for the 'Chicago piano' nickname, a musical quality of the sound of both the pompom and the submachine gun, and a similarity between the sweeping action involved in firing the guns and the sweeping action involved in playing keyboard instruments.
Solution 2:
Chicago as an adjective has been used since the ‘20s in different contexts:
used in combinations especially with reference to Chicago as a centre of 1920s–30s gangsterism.
Chicago piano (n.)
a Thompson sub-machinegun, which achieved notoriety as the preferred weapon of Chicago gangsters in the 1920s and later.
- c.1943 [US] ‘Bill O. Lading’ You Chirped a Chinful!! n.p.: Chicago Piano: Tommy gun.
- 1946 [US] Charleston (WV) Daily Mail 2 Sept. 6/5: Me schmaltzy gabber couldn’t red a Chicago piano rap, so the D.A. conks me with a whole mag.
(GDoS)