We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Cholc

From Esolang
Jump to navigation Jump to search

Cholc is an esoteric programming language made up of sequences of musical chords.

Examples

Hello world

A A A A A A A A A
|: F G E Am :|
F Fm
|: C C C C C C C C A A A B Em :|
C Cm X
|: Db Eb Eb Eb Eb Eb C C C Fm :|
C C X
|: C C#m :|
Cm Cm X X
C C C X
Ebm X
D Dm
A A A A A X
|: F G Cm :|
Gm X
F Fm X
F F F X
Gm Gm 
D F# Bm |: Gm D F# Bm :|
Gm X
|: Gm Dm :|
G X
A X

output:

Hello, world!

Count up from 1 to 30

F F F F F F F F |: C C C C C C Fm :|
Dm Dm Dm Dm Dm Dm Dm Dm Dm
|: Ab Bb G Cm :|
Am Am Am |: |: G Gm X F Bb X D :| G X |: Bbm Dm Fm :| Bb Bbm X A :|

output:

010203040506070809101112131415161718192021222324252627282930

Specification

Operators

Operators in Cholc are similar to Brainfuck. They move a pointer, and increment/decrement its value.

Operator Role
{major chord} increment the value referred by the pointer
{minor chord} decrement the value referred by the pointer
|: jump right after to the corresponding :| if the value referred by the pointer is 0
:| jump right after to the corresponding |: if the value referred by the pointer is not 0
v read 1 byte from an input and write to the pointer
X write the value referred by the pointer to an output

Only triad major/minor chords can be used as operators. Other chords such as 7th or sus4 cannot be used. A hash # and an alphabet b is used as a sharp and flat symbol respectively. Here is an example of chord operations.

C
Cm
F#
Bbm
// Any enharmonic equivalents can be used
A#m

Moving pointer

Moving pointer in Cholc is defined by chord progressions. The movement of the pointer depends on the interval between the two chords in a row.

Progression Interval Example Pointer movement
weak progression 7 semitones (perfect 5th) C G 1
strong progression 5 semitones (perfect 4th) G C -1

Any pair of chords moves the pointer and its movement is "how many times to add perfect fifth".

Here are the rules of the movement.

  • major/minor does not affect to the pointer movement
  • if movement > 5, subtract 12 (treated as negative movement)

Example:

Chords Pointer movement
C C 0
C G +1
C D +2
C B +5
C Gb -6
C F -1
F Bb -1
F G +2
C Fm -1
C Cm 0

Order of pointer movement

The pointer movement occurs between two chord operations.

For example, C G is evaluated in this order.

At first, all memory is filled with 0 and the pointer refers address 0.

Address 0 1
pointer here
value 0 0

Chord C is evaluated and the value is incremented.

Address 0 1
pointer here
value 1 0

Chord progression C G is evaluated and the pointer is moved to address 1.

Address 0 1
pointer here
value 1 0

Finally chord G is evaluated and the value is incremented.

Address 0 1
pointer here
value 1 1

Turing completeness

Cholc is turing complete. Any Brainfuck source code can be converted to a Cholc source code by the covertion table below.

Brainfuck Cholc
+ C
- Cm
> C Cm E Em Ab Abm C Cm
< C Cm Ab Abm E Em C Cm
[ |:
] :|
, v
. X

External resources

  • Implementation: an implementation and online playground written in TypeScript
  • Playground: an online playground where the sound of the chord can be played during the evaluation