import random piece = 0 on_switch = 1 bach_feature = ["F Major Chord", "Idea 1", "Non-cadential 6-4 chord", "modulation to C major", "running bass", "cycle of 5ths", "cadence in D Minor", "perfect cadence in D Minor", "ascending melodic sequence", "lower chromatic auxiliary note", "point at which the ripieno is split into two distinct rhythmic parts", "harmonic sequence that isn't a cycle of 5ths", "V7d chord in Bb Major", "V7d chord in C", "V7d chord in A Major", "V7d chord in D minor", "V7a chord in Bb major", "suspension that could also be an appogiatura", "chain of suspensions", "modulation to G minor", "passage written in unison", "vii diminished chord", "V7d chord in Eb", "Cadence in A minor"] beethoven_feature = ["Appogiatura that could also be a suspension", "V7a in F minor", "vii diminished in C", "chord V in Eb", "passing modulation to F min", "modulation to the submediant major", "harmonic sequence", "antiphony", "perfect cadence into D", "vii diminished chords used to modulate", "diminished 7th in F sharp in its 2nd inversion", "modulation to the dominant of the dominant", "truncation", "neapolitan chord in its 1st inversion", "Ib in F minor", "vii dim 1st inversion in Db major", "homophonic passage of more than 20 bars", "tutti statement of the first subject in unison", "cadenza like figure played by the oboe", "Augmented 6th chord", "imperfect cadence", "arpeggiated or broken vii diminished chord", "prepared appogiatura", "Db major chord in its first inversion", "statement of the first subject inverted", "diminution", "descending diatonic sequence in C minor", "perfect cadence", "extension of the second subject, stated in thirds", "cadential 6-4 chord"] handel_feature = ["V7d chord in G major", "Ib chord in G major", "ii7d chord", "4-3 suspension", "diminished 7th in B minor", "Imperfect cadence", "melismatic writing", "modulation to B minor", "Major phrygian cadence", "vii chord in its first inversion", "fanfare", "passage demonstrating homophonic writing", "D pedal", "sequential running bass line", "iii chord in D major", "roulade", "imitative texture", "modal chords", "tonic bass pedal", "Phrygian cadence", "cycle of 5ths in vii chords", "neapolitan 6th chord", "iiib chord", "7-6 suspension", "perfect cadence into D", "plagal cadence with a vii chord stuck in the middle", "cadential vii chord"] schubert_feature = ["diminished 7th chord", "4-3 suspension", "feminine ending cadence", "cadence into F sharp major", "vii7b chord", "iib7 chord", "example of word painting representing water", "perfect cadence in B major", "recitative-like writing", "Augmented 6th chord", "melisma", "Interrupted cadence", "tonic bass pedal", "vii7 over a tonic bass pedal", "passage in the neapolitan key", "iib chord"] chosen_bach = 0 chosen_beethoven = 0 chosen_handel = 0 chosen_schubert = 0 print("Welcome to the random AS Music question generator") input() while on_switch = 1: piece = random.randint (1,4) if piece = 1: chosen_bach = random.choice(bach_feature) print("identify a") print(chosen_bach) print("in Bach's Brandenburg concerto, 1st movement") input() if piece = 2: chosen_beethoven = random.choice(beethoven_feature) print("identify a") print(chosen_beethoven) print("in the first movement of Beethoven's Fifth Concerto") input() if piece = 3: chosen_handel = random.choice(handel_feature) print("identify a") print(chosen_handel) print("in Handel's Zadok the Priest") input() if piece = 4: chosen_schubert = random.choice(schubert_feature) print("identify a") print(chosen_schubert) print("in Schubert's Der Neugierige") input()
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question