Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
cycle-midi
Cycle.js drivers to send and receive notes using Web MIDI.
connectionDriver
connectionDriver
accepts a stream. Whenever that stream dispatches, it tries to connect to the instrument over Web MIDI. It returns a stream that dispatches true
when the connection attempt succeeds and false
when it fails.
instrumentDriver
instrumentDriver
accepts a stream of notes to send to the instrument. It may eventually return a stream of notes played on the instrument, but it doesn't do that yet.
function Background({ messages: message$, instrumentConnection: instrumentAvailability$ }) {
const connectionRequest$ = message$.filter(
message => message.type === 'connect_to_instrument'
);
const playRandomNote$ = message$.filter(
message => message.type === 'play_random_note'
);
return {
instrumentConnection: connectionRequest$,
instrument: playRandomNote$.map(
() => (
{
// the MIDI ID of the note, from 21 for A0 to 108 for C8
note,
// number of milliseconds to play a note for
duration: 150,
// 1 is very soft; 128 is very hard
velocity: Math.random() * 128,
// number of milliseconds since the instrument connection to wait
// before playing this note
time: 0,
}
)
),
messages: instrumentAvailability$.map(
isAvailable => (
{
type: 'instrument_availability_changed',
payload: true,
}
)
),
}
}
To see an real extension written with these drivers, check out the midicast source code.
yarn add cycle-midi
Because the two drivers share a single connection to the instrument, you must instantiate them together with makeInstrumentAndConnectionDriver()
:
import {
makeInstrumentAndConnectionDriver,
} from 'cycle-midi';
const {
instrumentDriver,
connectionDriver,
} = makeInstrumentAndConnectionDriver();
run(
Background,
{
instrument: instrumentDriver,
instrumentConnection: connectionDriver,
}
);
FAQs
Cycle drivers to control real instruments with WebMIDI
The npm package cycle-midi receives a total of 2 weekly downloads. As such, cycle-midi popularity was classified as not popular.
We found that cycle-midi demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.