I was very curious to find more info on the constant number study. So far I found this older HN post, which is itself quoting from an apparently famous book, which according to some replies was BSing the whole thing https://news.ycombinator.com/item?id=1995239
I couldn't find anything on a study at Cornell University, but I did find mention of a study at the University of Windsor that included 72 students in three groups: a control group, a group that listened to music before, and a group that listened to music before and during.
The results[2] are published in an article behind a paywall, but they give details of the two tasks presented to the subjects, neither of which involved actually writing code. One was a 15-minute task of locating syntax errors, another was a 20-minute task of locating logic errors.