cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <!-- 
Original pen by Greg Hovanesyan:
https://codepen.io/gregh/pen/RKVNgB 
-->

<div class="container">
  <div class="top-row">
    <div class="note-group group-of-two group-1">
      <div class="note note-1" data-frequency="207.65"><div>G#</div></div>
      <div class="note note-2" data-frequency="233.08"><div>A#</div></div>
    </div>
    <div class="note-group group-of-two group-2">
      <div class="note note-3" data-frequency="277.18"><div>C#</div></div>
      <div class="note note-4" data-frequency="311.13"><div>D#</div></div>
    </div>
    <div class="note-group group-of-three group-3">
      <div class="note note-5" data-frequency="369.99"><div>F#</div></div>
      <div class="note note-6" data-frequency="415.30"><div>G#</div></div>
      <div class="note note-7" data-frequency="466.16"><div>A#</div></div>
    </div>
    <div class="note-group group-of-two group-4">
      <div class="note note-8" data-frequency="554.37"><div>C#</div></div>
      <div class="note note-9" data-frequency="622.25"><div>D#</div></div>
    </div>
    <div class="note-group group-of-three group-5">
      <div class="note note-10" data-frequency="739.99"><div>F#</div></div>
      <div class="note note-11" data-frequency="830.61"><div>G#</div></div>
      <div class="note note-12" data-frequency="932.33"><div>A#</div></div>
    </div>
  </div>
  <div class="bottom-row">
    <div class="note note-13" data-frequency="196.00"><div>G</div></div>
    <div class="note note-14" data-frequency="220.00"><div>A</div></div>
    <div class="note note-15" data-frequency="246.94"><div>B</div></div>
    <div class="note note-16" data-frequency="261.63"><div>C</div></div>
    <div class="note note-17" data-frequency="293.66"><div>D</div></div>
    <div class="note note-18" data-frequency="329.63"><div>E</div></div>
    <div class="note note-19" data-frequency="349.23"><div>F</div></div>
    <div class="note note-20" data-frequency="392.00"><div>G</div></div>
    <div class="note note-21" data-frequency="440.00"><div>A</div></div>
    <div class="note note-22" data-frequency="493.88"><div>B</div></div>
    <div class="note note-23" data-frequency="523.25"><div>C</div></div>
    <div class="note note-24" data-frequency="587.33"><div>D</div></div>
    <div class="note note-25" data-frequency="659.25"><div>E</div></div>
    <div class="note note-26" data-frequency="698.46"><div>F</div></div>
    <div class="note note-27" data-frequency="783.99"><div>G</div></div>
    <div class="note note-28" data-frequency="880.00"><div>A</div></div>
    <div class="note note-29" data-frequency="987.77"><div>B</div></div>
    <div class="note note-30" data-frequency="1046.50"><div>C</div></div>
  </div>
</div>
            
          
!
            
              /*
Original pen by Greg Hovanesyan:
https://codepen.io/gregh/pen/RKVNgB 
*/
.container {
  margin: 0 auto;
  height: 100%;
  width: 588px;
  min-width: 588px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  .top-row {
    display: flex;
    position: relative;
    z-index: 2;
    .note-group {
      display: flex;
      justify-content: space-between;
      position: relative;
      top: 52px;
      &.group-of-two { width: 60px;  }
      &.group-of-three { width: 93px; }
      &.group-1 { margin-left: 17px; }
      &.group-2 { margin-left: 36px; }
      &.group-3 { margin-left: 42px; }
      &.group-4 { margin-left: 39px; }
      &.group-5 { margin-left: 38px; }
    }
    .note { margin-top: auto; }
  }
  .bottom-row {
    width: 100%;
    display: flex;
    justify-content: space-between;
    .note > div {
      display: flex;
      justify-content: center;
      align-items: flex-end;
    }
  }
}

.note {
  width: 27px;
  font-family: 'Roboto', sans-serif;
  font-weight: 900;
  font-size: 14px;
  line-height: 14px;
  color: #333333;
  text-align: center;
  perspective: 200px;
  user-select: none;
  & > div {
    background-image: linear-gradient(-180deg, #E9D5D0 0%, #E6E5F2 98%);
    box-shadow: 0px 2px 2px 0px rgba(0,0,0,0.26);
    border-radius: 3px;
    width: 100%;
    height: 100%;
    padding: 8px 0;
    box-sizing: border-box;  
    transform-origin: top center;
  }
  
  &:hover > div {
    background-image: linear-gradient(-180deg, #E3C377 3%, #ADDC9D 98%);
    transform: rotateX(-5deg);
  }
  
  &.note-1 { height: 183px; }
  &.note-2 { height: 178px; }
  &.note-3 { height: 168px; }
  &.note-4 { height: 163px; }
  &.note-5 { height: 153px; }
  &.note-6 { height: 148px; }
  &.note-7 { height: 143px; }
  &.note-8 { height: 133px; }
  &.note-9 { height: 128px; }
  &.note-10 { height: 118px; }
  &.note-11 { height: 113px; }
  &.note-12 { height: 108px; }
  
  &.note-13 { height: 183px; }
  &.note-14 { height: 178px; }
  &.note-15 { height: 173px; }
  &.note-16 { height: 168px; }
  &.note-17 { height: 163px; }
  &.note-18 { height: 158px; }
  &.note-19 { height: 153px; }
  &.note-20 { height: 148px; }
  &.note-21 { height: 143px; }
  &.note-22 { height: 138px; }
  &.note-23 { height: 133px; }
  &.note-24 { height: 128px; }
  &.note-25 { height: 123px; }
  &.note-26 { height: 118px; }
  &.note-27 { height: 113px; }
  &.note-28 { height: 108px; }
  &.note-29 { height: 103px; }
  &.note-30 { height: 98px; }
}

body {
  background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/355309/background.svg);
  background-color: #583864;
  background-size: auto 100%;
  display: flex;
  align-items: center;
}

html {
  height: 100%;
}
body {
  min-height: 100%;
  margin: 0;
}
            
          
!
            
              /*
Original pen by Greg Hovanesyan:
https://codepen.io/gregh/pen/RKVNgB 
*/
class Sound {
  
  constructor(context) {
    this.context = context;
  }
  
  setup() {
    this.oscillator = this.context.createOscillator();
    this.gainNode = this.context.createGain();

    this.oscillator.connect(this.gainNode);
    this.gainNode.connect(this.context.destination);
    this.oscillator.type = 'sine';
  }

  play(value) {
    this.setup();

    this.oscillator.frequency.value = value;
    this.gainNode.gain.setValueAtTime(1, this.context.currentTime);
            
    this.oscillator.start(this.context.currentTime);
    this.stop(this.context.currentTime);
  }
  
  stop() {
    this.gainNode.gain.exponentialRampToValueAtTime(0.001, this.context.currentTime + 1);
    this.oscillator.stop(this.context.currentTime + 1);
  }
 
}

let context = new (window.AudioContext || window.webkitAudioContext)();
            
          
!
999px
Close

Asset uploading is a PRO feature.

As a PRO member, you can drag-and-drop upload files here to use as resources. Images, Libraries, JSON data... anything you want. You can even edit them anytime, like any other code on CodePen.

Go PRO

Loading ..................

Console