Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

abcjs

Package Overview
Dependencies
Maintainers
1
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

abcjs - npm Package Compare versions

Comparing version 6.2.0 to 6.2.1

2

index.js
/**!
Copyright (c) 2009-2022 Paul Rosen and Gregory Dyke
Copyright (c) 2009-2023 Paul Rosen and Gregory Dyke

@@ -4,0 +4,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy

/**!
Copyright (c) 2009-2022 Paul Rosen and Gregory Dyke
Copyright (c) 2009-2023 Paul Rosen and Gregory Dyke

@@ -4,0 +4,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy

@@ -1,2 +0,2 @@

Copyright (c) 2009-2022 Paul Rosen and Gregory Dyke
Copyright (c) 2009-2023 Paul Rosen and Gregory Dyke

@@ -3,0 +3,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy

{
"name": "abcjs",
"version": "6.2.0",
"version": "6.2.1",
"description": "Renderer for abc music notation",

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

/**!
Copyright (c) 2009-2022 Paul Rosen and Gregory Dyke
Copyright (c) 2009-2023 Paul Rosen and Gregory Dyke

@@ -4,0 +4,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy

@@ -20,3 +20,3 @@ var TimingCallbacks = function(target, params) {

if (newTarget.noteTimings.length === 0)
newTarget.setTiming(0,0);
self.noteTimings = newTarget.setTiming(0,0);
if (self.lineEndCallback) {

@@ -23,0 +23,0 @@ self.lineEndTimings = getLineEndTimings(newTarget.noteTimings, self.lineEndAnticipation);

@@ -575,3 +575,3 @@ // abc_tune.js: a computer usable internal structure representing one tune.

this.noteTimings = [];
return;
return this.noteTimings;
}

@@ -578,0 +578,0 @@

@@ -168,2 +168,5 @@ var getNote = require('./load-note');

});
if (self.debugCallback)
self.debugCallback("notes "+JSON.stringify(notes));
// If there are lots of notes, load them in batches

@@ -185,4 +188,9 @@ var batches = [];

var next = function() {
if (self.debugCallback)
self.debugCallback("loadBatch idx="+index+ " len="+batches.length);
if (index < batches.length) {
self._loadBatch(batches[index], self.soundFontUrl, startTime).then(function(data) {
if (self.debugCallback)
self.debugCallback("loadBatch then");
startTime = activeAudioContext().currentTime;

@@ -199,2 +207,5 @@ if (data) {

} else {
if (self.debugCallback)
self.debugCallback("resolve init");
resolve(results);

@@ -211,2 +222,4 @@ }

batch.forEach(function(item) {
if (self.debugCallback)
self.debugCallback("getNote " + item.instrument+':'+item.note);
promises.push(getNote(soundFontUrl, item.instrument, item.note, activeAudioContext()));

@@ -234,2 +247,4 @@ });

if (pending.length > 0) {
if (self.debugCallback)
self.debugCallback("pending " + JSON.stringify(pending));
// There was probably a second call for notes before the first one finished, so just retry a few times to see if they stop being pending.

@@ -249,3 +264,5 @@ // Retry quickly at first so that there isn't an unnecessary delay, but increase the delay each time.

}
self._loadBatch(newBatch, soundFontUrl, startTime, delay).then(function (response) {
if (self.debugCallback)
self.debugCallback("retry " + JSON.stringify(newBatch));
self._loadBatch(newBatch, soundFontUrl, startTime, delay).then(function (response) {
resolve(response);

@@ -261,7 +278,14 @@ }).catch(function (error) {

list.push(batch[j].instrument+'/'+batch[j].note)
return Promise.reject(new Error("timeout attempting to load: " + list.join(", ")));
if (self.debugCallback)
self.debugCallback("loadBatch timeout")
return Promise.reject(new Error("timeout attempting to load: " + list.join(", ")));
}
} else
} else {
if (self.debugCallback)
self.debugCallback("loadBatch resolve")
return Promise.resolve({loaded: loaded, cached: cached, error: error});
}
}).catch(function (error) {
if (self.debugCallback)
self.debugCallback("loadBatch catch "+error.message)
});

@@ -309,2 +333,4 @@ });

var key = note.instrument + ':' + note.pitch + ':' +note.volume + ':' + Math.round((note.end-note.start)*1000)/1000 + ':' + panDistance + ':' + tempoMultiplier + ':' + (note.cents ? note.cents : 0);
if (self.debugCallback)
self.debugCallback("noteMapTrack "+key)
if (!uniqueSounds[key])

@@ -324,3 +350,3 @@ uniqueSounds[key] = [];

parts = {instrument: parts[0], pitch: parseInt(parts[1], 10), volume: parseInt(parts[2], 10), len: parseFloat(parts[3]), pan: parseFloat(parts[4]), tempoMultiplier: parseFloat(parts[5]), cents: cents};
allPromises.push(placeNote(audioBuffer, activeAudioContext().sampleRate, parts, uniqueSounds[k], self.soundFontVolumeMultiplier, self.programOffsets[parts.instrument], fadeTimeSec, self.noteEnd/1000));
allPromises.push(placeNote(audioBuffer, activeAudioContext().sampleRate, parts, uniqueSounds[k], self.soundFontVolumeMultiplier, self.programOffsets[parts.instrument], fadeTimeSec, self.noteEnd/1000, self.debugCallback));
}

@@ -327,0 +353,0 @@ self.audioBuffers = [audioBuffer];

@@ -19,3 +19,3 @@ // Load one mp3 file for one note.

if (xhr.status !== 200) {
reject(Error("Can't load sound at " + noteUrl));
reject(Error("Can't load sound at " + noteUrl + ' status=' + xhr.status));
return

@@ -22,0 +22,0 @@ }

@@ -5,3 +5,3 @@ var soundsCache = require('./sounds-cache');

function placeNote(outputAudioBuffer, sampleRate, sound, startArray, volumeMultiplier, ofsMs, fadeTimeSec, noteEndSec) {
function placeNote(outputAudioBuffer, sampleRate, sound, startArray, volumeMultiplier, ofsMs, fadeTimeSec, noteEndSec, debugCallback) {
// sound contains { instrument, pitch, volume, len, pan, tempoMultiplier

@@ -25,2 +25,4 @@ // len is in whole notes. Multiply by tempoMultiplier to get seconds.

// if the note isn't present then just skip it - it will leave a blank spot in the audio.
if (debugCallback)
debugCallback('placeNote skipped: '+sound.instrument+':'+noteName)
return Promise.resolve();

@@ -86,2 +88,4 @@ }

}
if (debugCallback)
debugCallback('placeNote: '+sound.instrument+':'+noteName)
fnResolve();

@@ -94,3 +98,7 @@ };

})
.catch(function () {});
.catch(function (error) {
if (debugCallback)
debugCallback('placeNote catch: '+error.message)
return Promise.resolve()
});
}

@@ -97,0 +105,0 @@

@@ -288,3 +288,3 @@ const {noteToMidi} = require('../../synth/note-to-midi');

if (capo) {
this.capo = capo;
this.capo = parseInt(capo,10);
}

@@ -291,0 +291,0 @@ this.transpose = plugin.transpose ? plugin.transpose : 0

@@ -10,2 +10,12 @@ var sprintf = require('./sprintf');

var y2 = roundNumber(y + dy);
// TODO-PER: This fixes a firefox bug where a path needs to go over the 0.5 mark or it isn't displayed
if (renderer.firefox112 && dy < 1) {
var int = Math.floor(y2)
var distToHalf = 0.52 - (y2 - int)
if (distToHalf > 0) {
y1 += distToHalf
y2 += distToHalf
}
}
var pathString = sprintf("M %f %f L %f %f L %f %f L %f %f z", x1, y1, x2, y1,

@@ -12,0 +22,0 @@ x2, y2, x1, y2);

@@ -15,2 +15,12 @@ var elementGroup = require('./group-elements');

var x2 = roundNumber(x + dx);
// TODO-PER: This fixes a firefox bug where a path needs to go over the 0.5 mark or it isn't displayed
if (renderer.firefox112 && Math.abs(dx) < 1) {
var higher = Math.max(x,x2)
var int = Math.floor(higher)
var distToHalf = 0.52 - (higher - int)
if (distToHalf > 0) {
x += distToHalf
x2 += distToHalf
}
}
var pathArray = [["M", x, y1], ["L", x, y2], ["L", x2, y2], ["L", x2, y1], ["z"]];

@@ -17,0 +27,0 @@ var attr = { path: "" };

@@ -365,6 +365,9 @@ var spacing = require('../helpers/spacing');

parent = parent.parentNode;
analysis.name = parent.dataset.name;
analysis.clickedName = closest.dataset.name;
analysis.parentClasses = parent.classList;
analysis.clickedClasses = closest.classList;
if (parent && parent.dataset) {
analysis.name = parent.dataset.name;
analysis.clickedName = closest.dataset.name;
analysis.parentClasses = parent.classList;
}
if (closest && closest.classList)
analysis.clickedClasses = closest.classList;
analysis.selectableElement = target.svgEl;

@@ -371,0 +374,0 @@

@@ -19,2 +19,3 @@ // abc_renderer.js: API to render to SVG/Raphael/whatever rendering engine

this.reset();
this.firefox112 = navigator.userAgent.indexOf('Firefox/112.0') >= 0
};

@@ -21,0 +22,0 @@

/**!
Copyright (c) 2009-2022 Paul Rosen and Gregory Dyke
Copyright (c) 2009-2023 Paul Rosen and Gregory Dyke

@@ -4,0 +4,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy

@@ -1145,3 +1145,3 @@ declare module 'abcjs' {

init(params?: MidiBufferOptions): Promise<MidiBufferPromise>
prime(): Promise<void>
prime(): Promise<{ status: string, duration: number}>
start(): void

@@ -1148,0 +1148,0 @@ pause(): number

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

var version = '6.2.0';
var version = '6.2.1';
module.exports = version;

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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