New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gameboy-sound

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gameboy-sound - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

4

lib/channel1.js

@@ -153,4 +153,4 @@ const dutyLookup = [

computeAudioChannels,
play({ freq, trigger=true, length=Infinity, duty=2, volume=15, fade=0, sweepFactor=0, sweepPeriod=7, left=true, right=true }) {
frequency = freq || frequency;
play({ freq=1798, trigger=true, length=Infinity, duty=2, volume=15, fade=0, sweepFactor=0, sweepPeriod=7, left=true, right=true }) {
frequency = freq;
FrequencyTracker = (0x800 - frequency) << 2;

@@ -157,0 +157,0 @@

@@ -0,1 +1,3 @@

const defaultPCM = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0];
export function wav() {

@@ -21,3 +23,3 @@ // cached current output sample

// pcm cycle
let PCM = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0];
let PCM = defaultPCM;
let lastSampleLookup = 0;

@@ -82,9 +84,8 @@

computeAudioChannels,
play({ freq, trigger=true, length=Infinity, samples=null, downshift=0, left=true, right=true }) {
const frequency = freq || frequency;
frequencyPeriod = (0x800 - frequency) << 1;
play({ freq=1798, trigger=true, length=Infinity, samples=defaultPCM, downshift=0, left=true, right=true }) {
frequencyPeriod = (0x800 - freq) << 1;
timeLeft = length;
if (samples && samples !== PCM) {
if (samples !== PCM) {
if (samples.length !== 32 || !samples.every(n => (n & 15) === n)) {

@@ -91,0 +92,0 @@ throw new Error('Expected 32 samples with values 0-15')

{
"name": "gameboy-sound",
"version": "0.0.4",
"version": "0.0.5",
"description": "Easy 3 kB library for 98% accurate Gameboy audio",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc