Build 1505 - Lots of audio improvements
Build 1505 has just gone live, this includes masses of audio changes, you can now play multiple voices (polyphonic audio), and create tracks and patterns for music (or sound effects).
As with the rest of Prism, this is still a bit rough around the edges (you can't yet create sequences of patterns to create an actual song yet, and there's no nice way to edit music) but it's all exposed to JavaScript so you can create music through code. The following is included as tune.js
var Audio = require("Audio") var bell = Audio.env(Audio.square()) .setAttack(1, 0.01) .setDecay(0.01) .setSustain(0.5, 0.25) .setRelease(0.5); var snare = Audio.env(Audio.mul(Audio.sine(), Audio.noise())) .setAttack(1, 0.01) .setDecay(0.01) .setSustain(0.5, 0.01) .setRelease(0.125); var p = Audio.pattern(); p.trackCount = 2; ////// var t = p.tracks[0]; t.length = 16; var r = t.rows; r[8].set("C-6", bell); r[9].set("G-6", bell); r[10].set("C-6", bell); r[11].set("E-6", bell); r[12].set("C-6", bell); r[13].set("D-6", bell); r[14].set("C-6", bell); ////// t = p.tracks[1]; t.length = 16; r = t.rows; r[0].set("C-4", snare); r[1].set("E-4", snare); r[2].set("A-4", snare); r[4].set("C-4", snare); r[5].set("E-4", snare); r[6].set("A-4", snare); r[8].set("C-4", snare); r[9].set("E-4", snare); r[10].set("A-4", snare); r[12].set("C-4", snare); r[13].set("E-4", snare); r[14].set("A-4", snare); ////// Screen.print(p); p.beep(); // beep makes playback wait till the track has played
This should make a reasonable amount of sense to anyone who has experienced Tracker type music programs in the past. First we define two voices (a digital bell sound and a percussive snare). Then we ask the Audio system to create a pattern, tell it that pattern contains two tracks, each track has 16 rows, then we push in notes and voices accordingly.
Build 1505 also now uses the SDL gamecontroller interface for the gamepad - this should hopefully standardise button mappings. See the gamepad.js example.
Files
Get Prism-384
Prism-384
JavaScript powered Virtual Computer
Status | In development |
Category | Tool |
Author | Grapefruitopia Industries |
Tags | 8-Bit, DRM Free, fantasy-console, javascript, linux, mac, Pixel Art, raspberry-pi |
Languages | English |
More posts
- Android support coming soon (hopefully!)Oct 14, 2020
- Build 2944 - Raspberry Pi and VS Code DebuggingJul 31, 2019
- Build 2608 - Small updates and SUMMER SALE!!Jun 25, 2019
- Build 2352 - Linux builds, and many improvementsFeb 24, 2019
- html5 demo now liveAug 24, 2018
- Build 1750 - Hello MacOS!Jul 14, 2018
- A little pixel paintingMay 21, 2018
- Build 1304 - lots of minor improvementsApr 29, 2018
- Build 1189 - Improved AudioApr 14, 2018
Leave a comment
Log in with itch.io to leave a comment.