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.

Filter by
Sorted by
Tagged with
47
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, ...
42
votes
11answers
4k 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 ...
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...
37
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 ...
36
votes
27answers
4k 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-...
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" ...
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 ...
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 ...
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 ...
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 ...
27
votes
15answers
11k views

Twinkle Twinkle Little Star

Write a program to play the popular English nursery rhyme. (This file is licensed under the Creative Commons Attribution-Share Alike 3.0 Unported license. Attribution: Helix84 at the English language ...
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 ...
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/...
24
votes
8answers
3k views

Generating guitar tabs?

Write the shortest program that generates guitar tabs for the chords given as input. So that the guitarists among you don't have an advantage, and to make it deterministic (and probably easier to ...
24
votes
6answers
3k views

Write the prettiest bytebeat composition

Bytebeat is a style of music one can compose by writing a simple C program that's output is piped to aplay or /dev/dsp. ...
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 ...
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): ...
22
votes
4answers
569 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 ...
22
votes
3answers
559 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 ...
21
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 ...
21
votes
11answers
2k 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 ...
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: ...
20
votes
1answer
400 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 ...
19
votes
7answers
892 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 ...
19
votes
10answers
1k 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 ...
18
votes
14answers
1k views

Translate number pairs to guitar notes

A guitar fretboard diagram looks like this: ...
17
votes
12answers
1k views

Are the beams above or below the notes?

In musical notation, groups of notes shorter than one beat are joined together by a line at the bottom called a beam. Here are a few bars of music with the beams highlighted: (Taken from Second Suite ...
17
votes
4answers
729 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 ...
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 ...
16
votes
4answers
2k views

Markov Chain Beatbox Generator

Just an idea I had the other day: Making beats following a Markov Chain of predefined sounds. I remember someone did a beatbox with Google Translate and the German language (follow the link and press ...
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 ...
15
votes
4answers
2k views

Create a GUI Piano [closed]

Challenge Create a GUI Keyboard with as few characters as possible. Example Because this was an assignment in one of my courses, I can't show the source code. However, here is a screen shot of my ...
15
votes
2answers
513 views

The Major-Minor Dichotomy

Given a list of chords label them as either 'Major' or ' Minor'. Input Input will be a list of chords, one per line, made up of 3 notes separated by a space. Each note will consist of the note name ...
15
votes
4answers
1k views

It's fun to stay at the Y.M.C.A

"Y.M.C.A." is a popular disco song by the Village People that has a well-known dance. Write the shortest program to output the capital letters "Y", "M", "C", and "A" synchronized to the song's chorus. ...
14
votes
11answers
554 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. ...
13
votes
4answers
1k 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 ...
13
votes
7answers
501 views

Make a random drum loop

Do randomly generated drum loops sound good? A drum loop is a \$5\times 32\$ matrix \$A\$ of \$1\$s and \$0\$s such that \$A_{1,1}=A_{1,17}=A_{2,9}=A_{2,25}=1\$, for each \$i\$, the \$i\$th row has ...
12
votes
7answers
1k 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 ...
11
votes
4answers
467 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 ...
11
votes
7answers
490 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). ...
11
votes
3answers
449 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 ...
11
votes
2answers
695 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 ...
10
votes
6answers
438 views

Print the sizes of intervals inside of a piece of music

Background In Western music, every single music note has an assigned name. Within each octave, there are twelve unique notes in the following order: "C C#/Db D D#/Eb E F F#/Gb G G#/Ab A A#/Bb B C", ...
10
votes
1answer
328 views

Scale from key and mode

Most of you probably know the C major scale: C D E F G A B C The major scale is characterised by the intervals between adjacent notes, which measured in ...
10
votes
1answer
187 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 ...
9
votes
7answers
1k views

Approximate the perfect fifth

Starting at 1-TET, give equal temperaments that have better and better approximation of the perfect fifth(just ratio 3/2). (OEIS sequence A060528) The formal description of the sequence, copied from ...
9
votes
5answers
3k 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, ...
9
votes
1answer
446 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-...
9
votes
7answers
459 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 ...
9
votes
4answers
430 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, ...