Skip to content

Play tones through an LCD monitor from a web page using an electronics quirk in some displays.

Notifications You must be signed in to change notification settings

marekdedic/screentunes

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Screen Tunes

Code Climate

It turns out that some LCD monitors will emit a tone when patterns of repeating bars are displayed on the screen. This pattern varies based on the size of the bars. The goal of this project is to eventually be able to play some music through the screen using a web page.

I found out about this effect from the Hacker News comments on a page that was about a completely different bar spacing effect but produced sound out of some monitors (including my external Samsung LCD). Some commenters produced theories including that this is caused by the expansion and contraction of capacitors/inductors in the display as the screen scans down and the black pixels take a different amount of power than the white pixels. This theory suggests that varying the width of the bars would change the pitch, which indeed does happen.

This is mainly intended as an experiment out of curiosity and geekery; it has no practical use.

Technique

I simply created a full screen canvas where I draw an animated and variably spaced sequence of black and white bars. Displaying this pattern in a large browser window on some LCD monitors produces a tone.

Music

The script can play some basic music, which it loads from the file song.json. In this file, there must be:

  • duration - the overall duration of the song, after which the song will be repeated
  • individual notes with starting duration as the attribute and the note as the value

Notes are not named(due to inconsistent naming) but instead are represented as the number of semitones (half-steps) from the base note. The script is calibrating the device in such a way, that it tries to fit the first octave (values 0 to 12) to the device tonal range.

Calibration

Before the actual script is started, the user is prompted to sed the lowest and highest tone, which he can hear. The script then shifts the whole scale to best fit these settings.

About

Play tones through an LCD monitor from a web page using an electronics quirk in some displays.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 52.8%
  • HTML 37.3%
  • CSS 9.9%