So code and mechanical music (i.e. a recording) aren't exactly the same, but code and music compositions are more similar. Can you use a tiny snippet from a composition and still infringe copyright? Yes, you can. Maybe not however short, but there will come a point.