Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [music]

This tag indicates that the challenge involves music, e.g. taking music as input, producing music as output or handling musical notes.

16
votes
9answers
2k views

Is this a Major Scale (or equivalent)?

Sandbox The major scale (or Ionian scale) is one of the most commonly used musical scales, especially in Western music. It is one of the diatonic scales. Like many musical scales, it is made up of ...
14
votes
11answers
506 views

Help me play the Trumpet

The trumpet is a valved aerophone instrument, usually pitched in B♭. The sound is made when the player vibrates their lips to displace air inside the instrument. ...
21
votes
11answers
1k views

How many semitones

Guidelines Task Given two notes, inputted as strings or lists/arrays, calculate how many semitones apart they are (inclusive of the notes themselves), outputting as a number. Explanation of a ...
21
votes
3answers
426 views

Draw an ASCII key signature

Given an input of a note, output an ASCII drawing of the corresponding major key on the treble clef. Here are all the major keys (that don't include double-sharps or double-flats) and their ...
20
votes
11answers
2k views

Print me a scale

Oh no! I have a theory test soon and I don't remember the scales yet! Help me remember my major scales by printing the following: ...
12
votes
7answers
957 views

Convert between Music clefs

Before you leave, you do not have to understand much musical notation to do this challenge. EXPLANATION In standard sheet music, double clefs go across the page serving as reference points to the ...
36
votes
18answers
2k views

Consonance or dissonance?

Given two note names, you are to write a program that determines if the interval formed by these two notes is consonant or dissonant. Introduction In Western music, there are only 12 "different" ...
31
votes
3answers
2k views

Sheet music ASCII-art generator

Note: Anders Kaseorg warns me that this could be a duplicate of another previous question. It seems so, and I'm sorry I did not find that question before posting this one. Nonetheless, that question ...
7
votes
2answers
302 views

Generate chord charts for ukulele

Your task is to write a function which outputs a ukulele chord chart in the following format for a given chord symbol. For instance, for input "G7", it must output: ...
-5
votes
5answers
321 views

Get this song stuck in my head [duplicate]

Your challenge is to play these notes (speakers or to a sound file) in this order: C A F G Specifically, you must play these frequencies one after the other: <...
9
votes
5answers
2k views

Piano Chords on White Keys

Backstory [which is not true] A piano is set up like this: However, on my piano, all of the black keys are broken! I still want to be able to play some chords on my broken piano though. In music, ...
20
votes
1answer
366 views

Good Vibrations

The sound of the theremin has been immortalized in The Beach Boys song Good Vibrations. Many also associate its sound with the theme for the original series of Star Trek, though apparently it was a ...
46
votes
15answers
7k views

Attack, Decay, Sustain, Release

Sound synthesizers use envelope generators to control how certain parameters of the sound (such as overall loudness) change with time. In many synthesizers an envelope is defined by four parameters, ...
22
votes
4answers
498 views

What did I just play? Translate guitar fingerings to chords

Related: Music: what's in this chord?, Notes to Tablature, Generating guitar tabs?, Translate number pairs to guitar notes Given a guitar fingering, output the chord it represents. You can use ...
6
votes
1answer
349 views

Compose a Song! [closed]

Preface The available keys are the keys of the A through G and A minor through G minor. The Challenge Create a program that creates and saves to a playable audio file a "song" of using (uniformly ...
29
votes
8answers
1k views

Play some of Pachelbel's Canon

Output the following excerpt from Pachelbel's Canon in D as audio: Rules Any format/encoding may be used, so long as a codec existed prior to the creation of this challenge Any instrument (a real ...
18
votes
14answers
1k views

Translate number pairs to guitar notes

A guitar fretboard diagram looks like this: ...
11
votes
7answers
456 views

Music Interval Solver

In music theory, an interval is the difference between two pitches. Each pitch is defined by the number of half-steps (The difference between C and C#) or whole steps (The difference between C and D). ...
36
votes
25answers
3k views

Building a Metronome

Introduction Some days ago I needed a metronome for something. I had none available so I downloaded an app from the App Store. The app had a size of 71 MB!!! 71 MB for making tic-toc...?! So code-...
20
votes
11answers
3k views

What is the frequency of this note?

Quick musical refresher: The piano keyboard consists of 88 notes. On each octave, there are 12 notes, C, C♯/D♭, D, D♯/E♭, E, F, F♯/G♭, G, G♯/A♭, A, A♯/B♭ and ...
7
votes
1answer
201 views

Brass Fingerings

For this challenge, you need to print out the fingerings for various brass instruments. The notes an instrument can play (as well as their fingerings) are listed below: ...
33
votes
15answers
1k views

Find the syncopation

Given an input of a string consisting entirely of qs representing quarter notes and es representing eighth notes, output the ...
10
votes
1answer
183 views

Unfold musical jumps

The Dal Segno and Da Capo are two very commonly used musical terms. They mean "from the sign" (𝄋) and "from the beginning" respectively. There is also the idea of the coda (𝄌), which is the very ...
31
votes
10answers
2k views

Play “Taps”​​​​

Today, November 11, 2015, is Veterans Day in the United States. "Taps" is the bugle call played at U.S. military funerals: ("Taps" on SoundCloud from vtmiller) It is a ...
11
votes
3answers
433 views

Let's Make Music!

Lots of people like to play music for fun and entertainment. Unfortunately, music is pretty difficult sometimes. That is why you're here! Task It's your job to make reading music much easier for ...
8
votes
2answers
590 views

Play an RTTTL song

User quartata posted this challenge, but he neglected the fact that, for whatever reason, he's not able to play MIDI files on his computer. Let's help him out by writing a full program that reads a ...
7
votes
4answers
464 views

Code me a Jam!!

On occasion I get a little blue and need a little music to cheer me up, but clicking the start button and finding my media player takes sooooooo long. I want a faster way to play a song. The ...
15
votes
5answers
1k views

RTTTL Obfuscation

RTTTL, or Ring Tone Text Transfer Language is a music format that was invented by Nokia in the dawn of time when dinosaurs roamed the land. It allows for fairly crude pieces of music (no chords or ...
41
votes
11answers
3k views

Let us play the ocarina

As we all know, the Zelda series are one of the best game series ever made. In honor of that, let us play some songs on the ocarina. Challenge: Write a program which, given a song, outputs the score ...
4
votes
3answers
185 views

Output optimal trill fingerings

Note: all array references in this post are zero-indexed. When playing the piano, two notes on the same key must be pressed with two different fingers. You could use the same finger, but it doesn't ...
27
votes
1answer
1k views

ASCII Scores ­­­­­

Digging around in the depths of your temp folder, you find some compositions for the piano. Unfortunately, these compositions were written with note names and durations only, and you only have access ...
13
votes
2answers
445 views

Display a MIDI Track

Background MIDI files are quite different from WAV or MP3 audio files. MP3 and WAV files contain bytes representing a "recording" of the audio, while MIDI files have a series of MIDI messages stored ...
9
votes
7answers
447 views

Find the longest musical substring

A musical string is any string that can be played on a piano keyboard. For those of us who weren't forced to learn the piano as kids, here is what the keyboard looks like. So the string ...
11
votes
4answers
449 views

The Sound of Words

People have written many things allowing one thing to be visualized as another. Now I propose being able to translate letters to music! Its your job to write a program that takes a text file and ...
6
votes
7answers
556 views

Black or white keys of jazz chords?

When playing the piano, I realized that to play a chord right, I usually need to remember just which tones of the chord are played on white and which on black keys. The rest is usually handled by the "...
4
votes
1answer
302 views

Print the fingering for the note on a saxophone

Your challenge is, given a series of notes, print the fingerings that minimize the amount of movements you need to make (explained below). My not standard way of transforming fingerings to text: The <...
9
votes
3answers
581 views

Music: What's the name of this chord?

This is the reverse of Music: what's in this chord?, which is to print the notes in a given chord. This time the input is a list of notes in a chord, and your task is to output which chord it is. ...
7
votes
1answer
416 views

Notes to Tablature

Challenge Given a list a notes, you must return the corresponding tablature. Notes The notes must be in the range of A to G inclusive and the octave range being 2 to 6 inclusive. The format is note-...
8
votes
6answers
877 views

Help Me Play My Harmonica

Yesterday, I bought a harmonica: Figure 1: The harmonica. However, my dreams of being able to play soulful blues harmonica that moves people and causes a grown man to cry were quickly dashed by two ...
22
votes
9answers
1k views

Musical Quines on an ASCII Piano

There are 88 keys on a standard piano and 95 printable ascii characters (hex codes 20 through 7E): ...
19
votes
7answers
863 views

Organise the Gregorian Church's Music

The year is 930, and the Gregorian Church is having a problem. They have thousands of pages of chant music, but the problem is that all the sheet music was simply thrown onto a pile instead of having ...
9
votes
4answers
409 views

Tuning Strings­

Task Write a program to determine the note sounded, along with how many cents out of tune, of a string tuned to a given frequency and pressed down at a given point. For the sake of simplicity, ...
24
votes
1answer
2k views

Print the lyrics to “Twinkle Twinkle Little Star”

Your goal is to print the lyrics to the song "Twinkle Twinkle Little Star" as each note is played. The computer's microphone will hear notes. If the pitch (but not necessarily the length) of the note ...
36
votes
2answers
2k views

Musical Tweet Challenge

This is the audio version of the Twitter image encoding challenge. Design an audio compression format that can represent at least one minute of music in 140 bytes or less of printable UTF-8-encoded ...
38
votes
11answers
2k views

Music: what's in this chord?

Input The symbol of any triadic chord (see http://en.wikipedia.org/wiki/Chord_(music)#Triads). Output The notes constituting the given chord. Examples Input: AM...
19
votes
10answers
987 views

The Note of Destiny - place a note on a staff

The zombie apocalypse has come, and the world is coming to an end. Suddenly, someone discovers a formula that takes the current hour, minute, and day, and spits out the perfect note to play on a piano ...
1
vote
1answer
246 views

Computer Generated Olympic Theme Song [duplicate]

Try to regenerate the olympic theme song, "Bugler's Dream" using the programming language of your choice. The language/platform used must be able to emit the physical sound. Only playing the main ...
27
votes
1answer
2k views

Find the beats in an MP3 file

In this challenge, your task is to take an simple recording in mp3 format and find the time offsets of the beats in the file. Two example recordings are here: https://dl.dropboxusercontent.com/u/...
11
votes
2answers
682 views

Just one note - musical instrument synthesizing [closed]

Statement The task is to synthesize sound (one note played) of some musical instrument (of your choice) using function in some general purpose programming language (of your choice). There are two ...
13
votes
4answers
982 views

Mozart golf - mini “Rondo”

Output "Mozart - Alla Turca" to stdout (see the sample for "reference implementation") Try to find how to pack both synthesizer and the music into minimal size. Requirements: Format suitable for ...