是什么意思
2024-08-31 21:54:31
发布于:广东
Veronica attends a music academy. She was given a music sheet of a composition with only notes (without annotations), and needs to recognise the scale used. In this problem, we will limit ourselves to only the two most frequently used (and usually taught in schools first) scales: A-minor and C-major.
This doesn't make them simpler or more basic than other minor and major scales – all minor scales are mutually equivalent save for translation, and so are major scales.
Still, out of the 12 tones of an octave {A, A#, B, C, C#, D, D#, E, F, F#, G, G#} used in modern music1, A-minor and C-major scales do use the tones with shortest names: A-minor is defined as an ordered septuple (A, B, C, D, E, F, G), and C-major as (C, D, E, F, G, A, B).
Notice that the sets of tones of these two scales are equal. What's the difference? The catch is that not only the set of tones, but also their usage, determines a scale. Specifically, the tonic (the first tone of a scale), subdominant (the fourth tone) and dominant (the fifth tone) are the primary candidates for accented tones in a composition. In A-minor, these are A, D, and E, and in C-major, they are C, F, and G. We will name these tones main tones.
Aren't the scales still equivalent save for translation? They are not: for example, the third tone of Aminor (C) is three half-tones higher than the tonic (A), while the third tone of C-major (E) is four halftones higher than the tonic (C). The difference, therefore, lies in the intervals. This makes minor scales “sad” and major scales “happy”.
Write a program to decide if a composition is more likely written in A-minor or C-major by counting whether there are more main tones of A-minor or of C-major among the accented tones (the first tones in each measure). If there is an equal number of main tones, determine the scale based on the last tone (which is guaranteed to be either A for A-minor or C for C-major in any such test case).
For example, examine the well-known melody “Frère Jacques”2 :
CD|EC|CD|EC|EF|G|EF|G|GAGF|EC|GAGF|EC|CG|C|CG|C The character “|” separates measures, so the accented tones are, in order: C, E, C, E, E, G, E, G, G, E, G, E, C, C, C, C. Ten of them (C, C, G, G, G, G, C, C, C, C) are main tones of C-major, while six (E, E, E, E, E, E) are main tones of A-minor. Therefore, our best estimate is that the song was written in C-major.
输入格式
The first and only line of input contains a sequence of at least 5, and at most 100, characters from the set {“A”, “B”, “C”, “D”, “E”, “F”, “G”, “|”}. This is a simplified notation for a composition, where the character “|” separates measures. The characters “|” will never appear adjacent to one another, at the beginning, or at the end of the sequence.
输出格式
The first and only line of output must contain the text “C-dur” (for C-major) or “A-mol” (for Aminor).加粗文本
全部评论 4
可以用下翻译
2024-09-02 来自 浙江
1维罗妮卡在音乐学院学习。她收到了一张乐谱,上面只有音符(没有注释),需要识别所使用的调式。在这个问题中,我们将仅限于使用两种最常用的(通常在学校最先教授的)调式:A小调和C大调。
这并不意味着它们比其他小调和大调更简单或更基本——除了平移之外,所有的小调都是相互等价的,大调也是如此。
不过,在现代音乐中使用的八度音阶的12个音调{A,A#,B,C,C#,D,D#,E,F,F#,G,G#}中,A小调和C大调确实使用了名称最短的音调:A小调被定义为有序的七度音阶(A,B,C,D,E,F,G),而C大调则为(C,D,E,F,G,A,B)。
请注意,这两个音阶的音调集合是相同的。区别何在?关键在于,不仅音调集合本身,其使用方式也决定了一个音阶的特性。具体来说,主音(音阶的第一个音)、下属音(第四音)和属音(第五音)是乐曲中需要强调的主要音。在A小调中,这些音分别是A、D和E;而在C大调中,则是C、F和G。我们将这些音称为主音。
音阶除了转换之外,难道不是等价的吗?其实不然:比如A小调的第三音(C)比主音(A)高三个半音,而C大调的第三音(E)则比主音(C)高四个半音。因此,差异在于音程的不同。这使得小调音阶显得“悲伤”,而大调音阶则显得“欢快”。
编写一个程序来判断乐曲更可能采用A小调还是C大调创作。具体方法是统计每个小节重音音(即每小节的第一个音)中A小调或C大调主音的数量。当两种主音数量相等时,根据最后一个音确定调式——在任何测试案例中,这个音必定是A小调的A音或C大调的C音。
例如,看看著名的旋律“Frere Jacques2025-07-30 来自 北京
0如果条件允许可以使用谷歌翻译。
2024-09-03 来自 加拿大
0COCI 是克罗地亚的计算机竞赛,所以题目是英文的。可以用翻译器。推荐使用有道翻译。
2024-09-03 来自 加拿大
0
有帮助,赞一个