packbat [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=40166 Packbats' 2-node Instrument: the Commentary Track <p><a href="https://www.lexaloffle.com/bbs/?pid=packbats_2node">The Packbats' 2-node Instrument Collection</a> - on the BBS as <code>#packbats_2node</code> - came from the same place as <a href="https://www.lexaloffle.com/bbs/?tid=141467">our guide to Picotron's instrument designer</a>: with PICO-8 you had loads of instant sounds that came with the fantasy console, but with Picotron you didn't. So: we wrote a guide, then we made some instant sounds.</p> <p>The 2-node part (is it 2 nodes? does the output mixer count? if the output counts it's three) was for three reasons, only one of which makes us feel arrogant:</p> <ol> <li>By forcing us to make something simple, we get it done faster and easier, which means the community has it sooner.</li> <li>By leaving space for more nodes and leaving unused envelopes, we make it easier for musicians to modify our instruments to their needs.</li> <li> <p>By refusing to use all the tools at our disposal, we refuse to make you as a sound designer feel like you can't compete. We're proud of what we made, don't get us wrong, but the joy of playing in Zep's playgrounds is futzing around with Zep's beautiful tools and getting inspired. If you're down to give it a try, to get over the hump and to the point where you can just have fun making cool sounds, you'll find all kinds of amazing stuff you can make. If you then type &quot;[instrument] synth design&quot; into DuckDuckGo and click on some links, you'll make even more cool sounds because you'll have way taller giants than us newbies to stand on.</p> <p>This pack? Is good. You can make cool music with it. But you can make cool music with just about anything, because you're a musician and that's what we all do. But also, it's called playing music for a reason, and we don't want to take any toys away from you. Even just by making you feel like you don't have any reason to try.</p> </li> </ol> <p>...anyway, boosting our self-esteem aside (thank you all who expressed enthusiasm for our instruments!), we thought it would be nice to make a designers' commentary on the collection. We're told looking at presets can be educational, but we had a hard time parsing what was going on in a preset the times we tried to, so ... here's our thought process for each sound, how it works, and some of the changes we think can work for it. If you've already read our first guide and are looking for more, we hope this - here or in <a href="https://www.lexaloffle.com/bbs/files/40166/2node-notes.txt">Picotron text file form</a> - helps.</p> <p>(p.s. A good way to test changes which add nodes - new effects, modulators, or oscillators - is to use the mute button on the new item to compare.)</p> <p>(p.p.s. In v0.1.0e, when this pack was made, SFX files supported a maximum of 25 instruments. We're not going back to add an extra seven now that v0.1.0f is out, though - our work is done.)</p> <p>(p.p.p.s. At the very end of the document is an index listing off all the sound effects by what Picotron SFX tools we used, if you want to see how some particular one works.)</p> <h1>Drum Kit</h1> <p>The instrument pack is approximately sorted by what Hornbostel-Sachs numbers the instruments we've copied have, with one exception: we moved the membranophones to the top so that all the drum kit pieces would be in one place.</p> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"></p> <h2>[00]=&quot;kick&quot;</h2> <p>(HS-211.212.1. Originally [04].)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--[[pod_type=&quot;instrument&quot;]]unpod(&quot;b64:bHo0AGIAAABgAAAA8FF7aW5zdHJ1bWVudD1weHUAAygAAgAABAABEAYPKBABIAEgAfAAAhACDyAQASAPJQAPlgABMA9BkAEKEAQPzg9mEA-CIA9FIA82AA9g8KUPHPDHD-gKD-8PgA-3DQHwCH0=&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>The classic 808-style synth kick drum sound is playing a waveform with its pitch starting high and rapidly falling. For economy's sake, we used the same envelope for pitch (TUNE) and volume, and also...</p> <p>...I mean, it sounds better with a bit of distortion. And we weren't using our second node, so, use it for shape distortion. The parameters we have here - high GAIN, high ELBOW, moderate CUT - are pretty normal for giving a sound a bit more drive.</p> <p>You could probably go way harder on the distortion, we just don't have any instinct for that.</p> <p>Oh, little Picotron trick: by using the &quot;/4&quot; mode on the shape mix knob, we could dial in the volume more precisely to match the stock triangle sound. Which we did - all the instruments are volume-matched to aid with mixing.</p> <p>Suggestions for playing with it:</p> <ul> <li>Play with SHAPE parameters.</li> <li>Remove SHAPE effect.</li> <li>Change waveform.</li> <li>Add another carrier oscillator to the main one to thicken the sound.</li> </ul> <h2>[01]=&quot;tom&quot;</h2> <p>(HS-211.212.1. Originally [23].)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--[[pod_type=&quot;instrument&quot;]]unpod(&quot;b64:bHo0AGAAAABeAAAA8E97aW5zdHJ1bWVudD1weHUAAygAAgAABAABEAYPGBABIAUAD_AAAfAAAhACDyAQASAPJQIP7xEgBA-FD66AAQgQBAAPjwHwsQ8XAATwBQfwrw-4Cg--D4AP9w0B8Ah9&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>While wrapping the pack up, we decided we needed more percussion instruments, since those have a reputation for being hard to synthesize.</p> <p>The big difference between a tom and a kick, as far as we understand, is where the bulk of the sound lies. With a tom, you have a higher pitch.</p> <p>It's not actually pitched, though, so we wanted to make sure that it didn't just end with a static tone. That's where we got the stacked tone envelope thing: ENV-1 is an attack envelope, getting the sharp note of the initial sound, and then ENV-0 continues morphing the pitch as it fades out. But because the envelopes are so much shorter, the final pitch is much higher, giving it a mid-percussion sound.</p> <p>Other than that? We chose a square wave, both for contrast with the triangle-wave kick and because it sounded cool, so we decided to also bring in a filter to round off those edges. The low-pass closes on the attack envelope, so there's a lot of high-frequency sound initially for an even more dramatic attack, but the body of the instrument sound is less harsh.</p> <p>Suggestions for playing with it:</p> <ul> <li>Add some high pass to the filter setting.</li> <li>Change waveform and waveform envelope range.</li> <li>Adjust tune envelope ranges.</li> <li>Add shape effect for distortion.</li> <li>Add new oscillator to the main one, possibly with ENV-1 attached to volume so it's just beefing the attack.</li> </ul> <h2>[02]=&quot;snare&quot;</h2> <p>(HS-211.212.11. Originally [05].)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--[[pod_type=&quot;instrument&quot;]]unpod(&quot;b64:bHo0AGcAAABlAAAA8FZ7aW5zdHJ1bWVudD1weHUAAygAAgAABAABEAYPJxABIAEgAfAADxIQAg8gEAEgDyEgATAPn5ABCBAEDzAPmxAH8KcBYA8hEA8fCg8vCgUPFQUAChAF8LkP_AoP-w_AD-cNAfAIfQ==&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Making a perfect snare drum sound is really hard. But making a functional mid-percussion noise instrument that can fill in for a snare drum? That's very doable.</p> <p>This one is dead simple: noise into low-pass filter, envelope to fade it out. For added shaping, we put the env on the filter, too - again, sharp attack, duller core sound - but really there's nothing else here.</p> <p>Suggestions for playing with it:</p> <ul> <li>Adjust envelope parameters.</li> <li>Put an envelope on the high pass knob in the filter to take away low end after the initial attack.</li> <li>Add a new envelope to the oscillator volume knob with a short decay, extend the decay on ENV-0.</li> <li>Turn TUNE on the oscillator down substantially to get a different timbre to the noise.</li> <li>Add a separate WT-0 oscillator to the instrument and set it up to make a kick-like sound.</li> <li>Add an ECHO effect to imitate the technique where the stick impacts the drum head multiple times in quick succession when hitting it. (We stole this trick from Many - viscountexx on Twitch.)</li> <li>Add a SHAPE effect for distortion.</li> </ul> <h2>[03]=&quot;hi hat&quot;</h2> <p>(HS-111.142. Originally [06].)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--[[pod_type=&quot;instrument&quot;]]unpod(&quot;b64:bHo0AF0AAABbAAAA8Ex7aW5zdHJ1bWVudD1weHUAAygAAgAABAABEAYPJRABIAEgAfAADxIQAg8gEAEgDyEgASAPEA--kAEIEAQPGA9OAAQPQg_l8K4NAATwxQ-4Cg--D4AP9w0B8Ah9&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Same story: making a real cymbal sound is hard, but making something to do the job is not so hard. Instead of focusing on the low-pass filter, we mostly used the high-pass. The envelope is quite short, imitating a closed hi hat.</p> <p>The one hidden little trick is the R on the WAVE knob. This has very little effect because WT-1's sounds are quite similar (especially after filtering), but the R means every hit uses a random sound from the entire range ... and so is sliiiiightly different.</p> <p>(Initially we were going to include a very obvious use of the random envelope in the collection - square wave with random pulse width and low-pass resonant filter - but we ran out of slots, so you'll have to try that one on your own.)</p> <p>Suggestions for playing with the hi-hat:</p> <ul> <li>Adjust various knobs - e.g. low pass and high pass, decay of the envelope, TUNE.</li> <li>Add a tiny bit of RES to the filter. (This changes the sound drastically!)</li> <li>Add an ECHO effect.</li> <li>Add SHAPE distortion.</li> <li>Add a second, similar FILTER effect to remove even more low and/or high end.</li> </ul> <h2>[04]=&quot;crash cymbal&quot;</h2> <p>(HS-111.142. Originally [07].)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--[[pod_type=&quot;instrument&quot;]]unpod(&quot;b64:bHo0AF0AAABbAAAA8Ex7aW5zdHJ1bWVudD1weHUAAygAAgAABAABEAYPHhABIAEgAfAADxIQBg8gEAEgDyEgATAPLQSAAQgQBAAPdwAED0kPkfCuD0oADxHwxQ-4Cg--D4AP9w0B8Ah9&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This is basically the same as the hi hat, but with a few tweaks and a much longer envelope. There is also a subtlety in that the volume envelope is applied to both output and oscillator envelopes - this causes the sound to die off slightly quicker at first and slightly slower as it trails off - but it is deliberately quite similar to the hi hat sound so that you can interleave the two to get an open-hihat effect.</p> <p>All the same suggestions for playing with the hi-hat apply to the crash cymbal.</p> <p></div></div></div></p> <h1>Pitched Idiophones</h1> <p>You've already seen two idiophones - instruments with solid material that resonates to make the sound - but these are the ones that play notes.</p> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"></p> <h2>[05]=&quot;marimba&quot;</h2> <p>(HS-111.212. Originally [20].)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--[[pod_type=&quot;instrument&quot;]]unpod(&quot;b64:bHo0AG4AAABsAAAA8F17aW5zdHJ1bWVudD1weHUAAygAAgAABAABEAYPJRABIAEgAfAAAhAGDyMPHBEgDyEgBQ-TAAEED0EPJ4APEQIQBA8yDxIBMAIBEAEgBA9ADxoB8KEPHQ9AAfAFBvCvD-gKD-8PgA-3DQHwCH0=&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This one, we made out of pure vibes. Lots of choices we can't explain, I'm afraid.</p> <p>FM synthesis was an obvious choice for this - it's easy to put an envelope on FM depth to make the sound change as the note plays, and it's easy to make hollow timbres like you get from idiophones. In order to make the initial hammer-strike stand out, we stacked two volume envelopes: a fast envelope for the initial attack and a slow envelope with sustain for the body of the sound. Because ENV-0 (the body-sound envelope) takes care of silencing the sound on release, we didn't need any sustain on ENV-1 - we could control the range directly on the knobs.</p> <p>Suggestions for playing with it:</p> <ul> <li>4/1 ratio for FM modulation. The other ratios didn't sound like marimbas to us, but that one, maybe.</li> <li>Adding an additional oscillator to the instrument.</li> <li>Tweaking envelope parameters and ranges on knobs they control. (Unexpectedly interesting option: a tiny bit of attack on ENV-1.)</li> <li>Detuning the BEND knob on the FM modulator osc.</li> <li>Adding a SHAPE effect. (We had its gain drop after the initial attack using ENV-1, so the distortion mostly only affects that transient.)</li> <li>Adding an ECHO effect. This one is really sweet.</li> </ul> <h2>[06]=&quot;celesta&quot;</h2> <p>(HS-111.222. Originally [14].)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--[[pod_type=&quot;instrument&quot;]]unpod(&quot;b64:bHo0AGAAAABeAAAA8E97aW5zdHJ1bWVudD1weHUAAygAAgAABAABEAYPHRABIAEgAfAAAhACDyAQASAPISAFDx0P3wEEDzSQAQkgCiAPivCvDxcPYA8PsAGgDxDwrA-4Cg--D4AP9w0B8Ah9&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This one is, we fully admit, a JPEG of a JPEG. We made a celesta patch a while ago for PICO-8, and with that one, the echo and vibrato were big parts of that sound ... so we just kept those two things.</p> <p>To our credit, though, another part of that effect was a detune, and we went about making that part in a pretty clever way. Normally, you make a detune effect with two oscillators that are out of tune with each other, but we don't have two oscillators because we used that space for an echo instead. ... so instead we set the vibrato - which is to say, the rate at which the tuning changed - to 16 and the echo - that is, the timing between when the note plays and is repeated - to 10. And so we do have two notes playing at a time out of tune with each other ... but the second one is just the echo of the first.</p> <p>(We chose 10 and 16 because those are near the golden ratio, and that means multiple echos are relatively far from synchronizing.)</p> <p>I think it sounds nice playing high-pitched celesta parts, however accurate it is or isn't. The waveform is quite mellow.</p> <p>Suggestions for playing with it:</p> <ul> <li>Give it a sharper attack with an ADSR envelope (new or not) acting on the oscillator volume with the range restricted.</li> <li>Modify the timbre with FM or ring mod. This may be a bit tricky, but try things.</li> <li>Double up the echo effect.</li> </ul> <h2>[07]=&quot;steelpan&quot;</h2> <p>(HS-111.241.12. Originally [24].)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--[[pod_type=&quot;instrument&quot;]]unpod(&quot;b64:bHo0AGsAAABpAAAA8Fp7aW5zdHJ1bWVudD1weHUAAygAAgAABAABEAYPIBABIAEgAfAAAhAGDyUPEhEgDyEgAQ-9EAQPRAABcA8RAhAEDxBQAg8qEAEGEAQPIfCjD0EAC-AFDxQACfCtD-gKD-8PgA-3DQHwCH0=&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Looking at the list of Hornbostel-Sachs categories, we didn't like any of the pitched membranophones we saw, but we did think that one last pitched idiophone would be a good last instrument.</p> <p>FM synthesis was basically necessary for this one. We didn't even try to get the sound any other way. It being an idiophone, we decided to go straight for the non-integer ratios, on the grounds that it would make a non-harmonic sound - that is, one with overtones that aren't multiples of the bass frequency - because that harmonic pattern is a function of the physics of strings and tubes of air, not sheets of metal. From there, it was just listening.</p> <p>Oh, and we did that trick again where we have one fast envelope and one slow envelope.</p> <p>Suggestions for playing with it:</p> <ul> <li>Adjust decay on envelopes.</li> <li>Adjust volume on FM mod.</li> <li>Play with waveforms.</li> <li>Change level of detune between carrier and FM BEND knobs.</li> <li>Add echo.</li> <li>Add a mod or oscillator to the FM modulator. This is tricky but there's a few possibilities to find.</li> </ul> <h2>[08]=&quot;glass pad&quot;</h2> <p>(HS-...133.2? Originally [11].)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--[[pod_type=&quot;instrument&quot;]]unpod(&quot;b64:bHo0AFkAAABXAAAA8Eh7aW5zdHJ1bWVudD1weHUAAygAAgAABAABEAYPERABIAEgAfAAAhACDyAQASAPISABIAQAD06AAQkgDyggD8Dwrh8oD4APKPDFD-gKD-8PgA-3DQHwCH0=&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This did not start as an imitation of any acoustic instrument, hence the nonspecific name and number. We thought it was a little reminiscent of the armonica - that instrument made up of a bunch of glass bowls and played by friction from the fingertips - but originally we just wanted a beautiful electronic pad sound. So including it here is a bit of a cheat, but not really a harmful one or anything.</p> <p>The bulk of the effect is simply the volume envelope and the echo, but we did double the envelope onto the waveform dial to give it some more textural interest.</p> <p>Also, an interesting note about the echo: normally, a delay of 40 makes a quite noticeable, rhythmic echo, but because the attack and decay are also 40, it is smoothed out to unnoticeability and just gives the instrument an even bigger reverb effect.</p> <p>Suggestions for playing with it:</p> <ul> <li>Adjust ADSR parameters.</li> <li>Adjust echo parameters. (Recommend hitting Space to halt playback first, to avoid glitches.)</li> <li>Change waveform.</li> <li>FM or ring modulate waveform to get new timbres.</li> </ul> <p></div></div></div></p> <h1>Chordophones</h1> <p>Because we moved all our membranophones up, the next category is chordophones - instruments where the note starts as a vibrating string. Extremely popular class with Hornbostel and Sachs, we suspect - some of these have very specific numbers.</p> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"></p> <h2>[09]=&quot;piano&quot;</h2> <p>(HS-314.122-4-8. Originally [01].)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--[[pod_type=&quot;instrument&quot;]]unpod(&quot;b64:bHo0AGMAAABhAAAA8FJ7aW5zdHJ1bWVudD1weHUAAygAAgAABAABEAYPIBABIAEgAfAAAhAGDywPGREgDyEgASAED14PQZACEBQAESAPJA8gD6kRMA8q8KMPX-AHDxnwrw-4Cg--D4AP9w0B8Ah9&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Again, we have a quick attack envelope and a slower body envelope. We also forgo much of the work we could have done on designing the best body sound in favor of (a) simplicity and (b) making a thump sound to represent the hammer hitting the strings.</p> <p>We actually pulled a bit of a trick with that thump: 28 is quite a bit longer a thump than we'd prefer, so we set the pitch of our second (thump) oscillator to dive far into inaudibility before the time was up. You'll note also that said pitch is absolute, ignoring which note was played and its volume; this makes it more consistent, which feels better. With variable pitch, it gets chirpy as you move up the octaves.</p> <p>Suggestions for playing with it:</p> <ul> <li>Adjust envelope parameters.</li> <li>FM modulate the attack phase of the body oscillator (ENV-1 on VOL of the new modulator).</li> <li>Add a second carrier osc to the body oscillator with the same timbre (VOL = *64, WAVE = +0) and BEND it a lot to produce a jangly sound.</li> <li>Add a light echo to the output.</li> </ul> <h2>[10]=&quot;shamisen&quot;</h2> <p>(HS-321.312. Originally [17].)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--[[pod_type=&quot;instrument&quot;]]unpod(&quot;b64:bHo0AGoAAABoAAAA8Fl7aW5zdHJ1bWVudD1weHUAAygAAgAABAABEAYPKBABIAEgAfAAAhAGDyAPEBEgDyEgBQ_iAAEED44PGgGADxIQBggAESAPIA-uEAEwD6bwow8lDxwG8AUF8K8P_AoP-w_AD-cNAfAIfQ==&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>The shamisen is an instrument we Packbats missed out on, but got mentioned when we asked what to include. So, we went to get reference to draw from.</p> <p><a href="https://www.youtube.com/watch?v=el_loVyXDSg">Ki&amp;Ki's song &quot;Tokitsukaze&quot;</a> is (if we understand correctly) Tsugaru shamisen specifically. Most of the search results we saw on DDG were also Tsugaru shamisen, so Tsugaru shamisen it shall be. We don't know what else is out there.</p> <p>The striking aspects of the sound to us were the prominent plucking sound, the variable pitch (which mostly has to come from tracker effects, but those weren't implemented yet), and the very short sustain. And the stylistic aspects of play, but we don't know those so we can't help there.</p> <p>We created that aggressive pluck sound with four pieces: a hard sweep from sawtooth to sine-triangle, a big initial drop in volume, a big bend into the note, and noise, all on the A=5 attack envelope. We let the body envelope have a tiny bit of sustain - that felt closer to right - but the bulk of the sound design was in that pluck.</p> <p>We shan't have many suggestions for playing with the timbre of this one, just because we don't know the instrument, but a couple possibilities:</p> <ul> <li>Change the timbre of the WT-0 oscillator with some FM modulation, either on the whole sound or just attack.</li> <li>Change parameters (e.g. TONE of noise pluck, ENV values, volume ranges, etc.)</li> <li>Add an echo effect.</li> </ul> <h2>[11]=&quot;guitar&quot;</h2> <p>(HS-321.322. Originally [12].)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--[[pod_type=&quot;instrument&quot;]]unpod(&quot;b64:bHo0AGsAAABpAAAA8Fp7aW5zdHJ1bWVudD1weHUAAygAAgAABAABEAYPGhABIAEgAfAAAhAGDxwPIBEgDyEgBQ93AAEED3wPWwFwDxECEAQPIlASEAEgBA9VDywB8KEPJg8oA-AFBPCvD-gKD-8PgA-3DQHwCH0=&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Don't have an explanation for reaching for FM on this one. Seems to work, though.</p> <p>For the attack envelope, we modulated both oscillator waveforms, carrier and modulator. And we attached the body-of-sound envelope to the FM mod amount to get that slow mellowing of tone you hear with instruments like this.</p> <p>Suggestions for playing with it:</p> <ul> <li>SHAPE distortion. For the best effect, you may need to increase the volume in the Instrument box so the shape distortion has more to bite on to.</li> <li>Detune the BEND knob in the FM modulation.</li> <li>Add echo.</li> <li>Add an extra carrier oscillator to thicken the sound.</li> <li>Play with other parameters.</li> <li>Add other modifications (e.g. stack another FM mod).</li> </ul> <h2>[12]=&quot;e guitar&quot;</h2> <p>(HS-321.322. Originally [16].)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--[[pod_type=&quot;instrument&quot;]]unpod(&quot;b64:bHo0AGoAAABoAAAA8Fl7aW5zdHJ1bWVudD1weHUAAygAAgAABAABEAYPIBABIAEgAfAAAhAGD0APOxEgDyEgBQ8_AAEED3IPXwFwAQoQBA_BD0cPQAAPhCAPPyAH8KcPgQAH8AUD8K8P_AoP-w_AD-cNAfAIfQ==&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>For this one, we concentrated on overdrive to shape the sound. We, again, have an attack envelope to make the initial buzz, but the bulk of the sound is a tilted sawtooth wave being slowly less and less overdriven.</p> <p>Does it sound like a guitar? I don't know, but we were trying to make a guitar and it'll do for purpose.</p> <p>(Also, secret #packbats_2node cart lore: there's a third, hidden SFX file that wasn't open in the editor when we did the final export. Pattern 02 from that is this e guitar patch playing chords, and we really like how those chords sound.)</p> <p>Suggestions for playing with it:</p> <ul> <li>Change the envelope parameters and/or tweak knobs.</li> <li>Modify the body sound more fundamentally (e.g. with FM or ring modulation).</li> <li>Add another oscillator to harmonize (e.g. in fifths).</li> <li>Add an echo effect.</li> </ul> <h2>[13]=&quot;violin&quot;</h2> <p>(HS-321.322-71. Originally [00].)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--[[pod_type=&quot;instrument&quot;]]unpod(&quot;b64:bHo0AGIAAABgAAAA8FF7aW5zdHJ1bWVudD1weHUAAygAAgAABAABEAYPHhABIAEgAfAAAhACDyAQASAPISAFDA-xAQAPiQ_bgAEIEAQPHw9p8LEHDyQPtAuwAcAPP-CqD-gKD-8PgA-3DQHwCH0=&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>We started with this one because violins are the most pad-like acoustic instrument we could think of, so we wanted it so there would be at least one good pad.</p> <p>It's mostly simple - basically a low-passed sawtooth wave - but there's one technical detail in the FREQ=0 setting on the vibrato. With this specific value, the frequency of the tone variation will sync to the SFX.</p> <p>Suggestions for playing with it:</p> <ul> <li>Change the waveform to a different shape.</li> <li>Modulate the waveform with FM or ring mod to change it more.</li> <li>Alter envelope settings and/or filter range.</li> <li>Stack a new ADSR volume envelope on the oscillator volume knob to give it a more complex contour.</li> <li>Add resonance to the filter. It won't sound like a violin any more, but it can sound cool.</li> <li>Attach ENV-1 to the oscillator volume knob and adjust it to create a little tremolo.</li> <li>Add a little bit of echo.</li> </ul> <h2>[14]=&quot;harp&quot;</h2> <p>(HS-322. Originally [21].)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--[[pod_type=&quot;instrument&quot;]]unpod(&quot;b64:bHo0AGIAAABgAAAA8FF7aW5zdHJ1bWVudD1weHUAAygAAgAABAABEAYPHxABIAEgAfAAAhAGDx4PIhEgDyEgBQ8cAAEED4MPPwFwAQgQBA88D48B8LEPKg8nCfAFCfCvD-gKD-8PgA-3DQHwCH0=&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Another relatively simple patch - the bulk of our attention went into making the attack sound right. In this case, we went with oscillator and low-pass filter - it seems to work fine. It does sound more harp-like if successive notes are spread out across multiple channels so they can overlap.</p> <p>Suggestions for playing with it:</p> <ul> <li>A general note: for this one especially, you might want to test with a music pattern instead of or in addition to the keyboard - that way, you can hear the notes overlap.</li> <li>Add echo - it sounds dreamy.</li> <li>Play with envelope values.</li> <li>Modify the core sound by changing waveform and its range and/or with FM or ring modulation.</li> </ul> <p></div></div></div></p> <h1>Aerophones</h1> <p>Where many of the chordophones used struck strings that mellow during the body of the note, aerophones operate by sustained flow of air, making the general contour of the sound very different.</p> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"></p> <h1>[15]=&quot;pipe&quot;</h1> <p>(HS-421.?. Originally [02].)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--[[pod_type=&quot;instrument&quot;]]unpod(&quot;b64:bHo0AGwAAABqAAAA8Ft7aW5zdHJ1bWVudD1weHUAAygAAgAABAABEAYPIxABIAEgAfAAAhAGDyQPHBEgDyEMDycAAQ-9EAQPWQ86gA8hAiAPQFACDxIQAQMgB-CiCA8YD98KsAGgDyjwrA-4Cg--D4AP9w0B8Ah9&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This one, like the glass pad, started as a patch and was interpreted as a physical instrument later. We haven't played with ring modulation much, so it was nice finding such a sweet, gentle tone with it. You'll see that it's a non-integer ratio and that the TUNE of the oscillator is up an octave; mathematically, ring modulation creates waveforms at the difference and sum of the input frequencies, so a ratio of 3/2 gives us 1/2 and 5/2. (And then the tilted saw overtones bring in 7/2, 3/2 and 9/2, 11/2, and so on.) Ring mod isn't as prominent in 2024 as FM modulation, but as you can hear, you can find some nice tones.</p> <p>If you look at ENV-0, you'll see a very typical ADSR for horns and such: instead of being loud and sharp at the start and mellowing, it swells into its sharpest timbre and stays near it until the note ends.</p> <p>Suggestions for playing with it:</p> <ul> <li>Add some echo.</li> <li>Modify envelope parameters.</li> <li>Modify waveforms.</li> <li>Increase detune with the ring mod DETUNE knob.</li> <li>Apply a low-pass filter to dull the sound a little.</li> <li>Apply a gentle FM modulation to the ring mod.</li> </ul> <h1>[16]=&quot;flute&quot;</h1> <p>(HS-421.121.12. Originally [15].)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--[[pod_type=&quot;instrument&quot;]]unpod(&quot;b64:bHo0AGQAAABiAAAA8Dd7aW5zdHJ1bWVudD1weHUAAygAAgAABAABEAYPHRABIAEgAfAAAhACDyAQASAPISABIAQPLw9agA8RAhAEDxMAD0AwAgEQFgDwCSHwogYMD_oK8MUP_AoP-w_AD-cNAfAIfQ==&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Thank you, flute, for landing between the &quot;pipe&quot; and &quot;organ&quot; patches so the list doesn't say &quot;pipe organ&quot;.</p> <p>Again, just kinda reached for FM - if you have two nodes to work with, it's one of the most versatile options. Also, the note of a flute is bright and clear, which you can get with FM.</p> <p>Interesting mix of envelope assignments going every which way - that's what we get when our focus is on imitating a sound by ear, I think. We also used the 4x option on FM mod 'volume' to get an attack that's just a little stronger, especially for the attack.</p> <p>We focused on the treble notes, but the results are interesting in the bass register.</p> <p>Suggestions for playing with it:</p> <ul> <li>Adjust various parameters - waveform, envelope, FM VOL, maybe even TUNE although that can make the sound stop sounding like a flute.</li> <li>Add a new oscillator to emphasize part of the sound.</li> <li>Add an LFO to the oscillator volume for tremolo or the BEND knob for vibrato.</li> <li>Add an echo effect.</li> </ul> <h2>[17]=&quot;organ&quot;</h2> <p>(HS-421.222.11. Originally [03].)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--[[pod_type=&quot;instrument&quot;]]unpod(&quot;b64:bHo0AHEAAABwAAAA8C97aW5zdHJ1bWVudD1weHUAAygAAgAABAABEAYPGhABIAEgBQ8QD-EBwAIQAg8gEAEgDyEgAQIQBA82DxqAARUAEBsVAPAaIgMQAQ-8EAQPVw888KEFDygP-wewAaAPE-CsD-gKD-8PgA-3DQHwCH0=&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>The classic way to make an organ sound is to stack lots of oscillators in different octaves, maybe with some on the fifths too.</p> <p>With only two oscillators ... well, we tried a few variations, and putting the bass oscillator in the sine-triangle range (where overtones die off fast) and the treble two octaves up with a tilted saw (much more overtone-heavy) seemed to get us somewhere. It has a little of that effect where only some harmonics are emphasized.</p> <p>And we detuned the two oscillators a touch, because that's nice.</p> <p>Suggestions for playing with it:</p> <ul> <li>More oscillators! 2/1 ratio! 8/1 ratio! 16/1 ratio! Heck, 6/1 and 12/1 ratios! And detune all of them!</li> <li>Echo effect! A lot of the sound of a church organ is the sound of the room - adding space to an organ really, really works.</li> <li>Attach the LFO to the volumes of oscillators to get a tremolo effect - Leslie speakers are another famous tool used to enhance an organ sound. (We set the knobs so volume started high on one and low on the other, and that made a pretty rad effect!)</li> <li>Change volume, waveform, and envelope parameters.</li> </ul> <h2>[18]=&quot;oboe&quot;</h2> <p>(HS-422.112. Originally [22].)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--[[pod_type=&quot;instrument&quot;]]unpod(&quot;b64:bHo0AHMAAABxAAAA8GJ7aW5zdHJ1bWVudD1weHUAAygAAgAABAABEAYPHxABIAEgAfAAAhAGDyIPGxEgDyEMEAUPDw-wAQQPQZAPEQIQBA8WDyVAAg8QEAEwDvCiAw8oD6EGsAIBAAMFIC9-D--wrQ-4Cg--D4AP9w8NAfAIfQ==&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This should look mostly familiar - very like the flute, in fact - except for the data envelope.</p> <p>So, here's how we did that. We dialed in a nice amount of vibrato and tremolo, then adjusted the knob values and range on the vibrato with a temporary oscillator to get it dialed in to be in tune during the initial part. Because that's what it's for: the note starts steady, and then when it has settled in it starts to warble at the SPD of the SFX (that's what the SPD 0 setting does).</p> <p>Suggestions for playing with it:</p> <ul> <li>Play with envelope parameters, waveforms, amount of FM modulation.</li> <li>Add an echo effect.</li> <li>Try a low pass filter with resonance. We ended up aiming the range arc above the marker and putting ENV-0 on it, which makes the filter opens up at the start of the note.</li> <li>FM mod the FM mod, maybe? You can definitely change the timbre that way, especially if you use envelopes to shape it.</li> </ul> <h2>[19]=&quot;trumpet&quot;</h2> <p>(HS-423.233. Originally [13].)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--[[pod_type=&quot;instrument&quot;]]unpod(&quot;b64:bHo0AFoAAABYAAAA8El7aW5zdHJ1bWVudD1weHUAAygAAgAABAABEAYPHhABIAEgAfAAAhACDyAQASAPISABIAQPfg9PgAEIEAQPJQ9w8LEIDxkPvwrwxQ-4Cg--D4AP9w0B8Ah9&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Very simple wavetable-plus-filter design. The changing waveshape creates the trumpet-like attack, and that's tempered and mellowed by the filter. We ended up only wanting the one envelope to take care of all of it - it did the job.</p> <p>Suggestions for playing with it:</p> <ul> <li>Play with envelope parameters, waveform, filter.</li> <li>Add an extra volume envelope for more shaping.</li> <li>Possibly, add a little resonance to the filter.</li> <li>FM modulation on the oscillator can work, especially with ENV-0 on its volume.</li> <li>Add a vibrato LFO to the oscillator bend knob.</li> <li>Shape effect distortion, maybe? That could be fun.</li> </ul> <p></div></div></div></p> <h1>Electrophones</h1> <p>Electrophones - instruments whose vibrations originate in electronic circuitry, rather than air, chords, or other physical oscillators - are the most flagrantly underbaked part of the original Hornbostel-Sachs typology. The MIMO (Musical Instrument Museums Online) made a new revision which improved this tremendously, but we didn't see it when we were doing our Wikipedia research so we haven't actually used it. (Hence us placing electric guitar in chordophones, not here.)</p> <p>Instead, we just kinda yoloed it. The basses we put first, as they are based (heh) on a string instrument, at least conceptually, and they are all related; then the two Commodore-64-inspired designs went to the end as pure electrophones to finish it out.</p> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"></p> <h2>[20]=&quot;synth bass&quot;</h2> <p>(HS-53 (/321). Originally [08].)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--[[pod_type=&quot;instrument&quot;]]unpod(&quot;b64:bHo0AGEAAABfAAAA8FB7aW5zdHJ1bWVudD1weHUAAygAAgAABAABEAYPGRABIAEgAfAAAhAGDyAPFxEgDyEgASAED8wPvYABCBAED1MPvgFACvCrD3wADxDwBQ8a8K8P_AoP-w_AD-cNAfAIfQ==&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>The original and indispensable subtractive-synthesis bass patch: simple (square-ish, here) waveform into a resonant low pass filter which quickly closes. It'd be a travesty to leave this out.</p> <p>We did add a few fun details - stacking the volume envelopes, a slow shift in pulse width on the tone as the note fades - but this is straight-up just the classic subtractive bass synth. You just gotta.</p> <p>Suggestions for playing with it:</p> <ul> <li>Play with envelope parameters, filter parameters, waveform (triangles and sines don't work great but sawtooths do)</li> <li>Double up the filter, with more-or-less similar parameters and the same envelope.</li> <li>Add a second oscillator in WAVE +0 mode and recreate the filter after it so it filters both. Play with relative pitch in TUNE knob.</li> <li>Add a shape overdrive.</li> <li>Add an echo effect.</li> </ul> <h2>[21]=&quot;fm bass&quot;</h2> <p>(HS-53. Originally [09].)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--[[pod_type=&quot;instrument&quot;]]unpod(&quot;b64:bHo0AGUAAABjAAAA8FR7aW5zdHJ1bWVudD1weHUAAygAAgAABAABEAYPHRABIAEgAfAAAhACDyAQASAPISABD-4QBA9WDzGADxECEAQPQA8oQAIgAQQQBA8g8KMPKA_eAvDFD-gKD-8PgA-3DQHwCH0=&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>There's a YouTube channel, currently @carpathia808, which does oscilloscope deconstructions of classic VGM tracks. The <a href="https://www.youtube.com/watch?v=3VunpizM1aE">Sonic 2 &quot;Chemical Plant Zone&quot; episode</a> lives in our head rent-free. It's such a good track and the deconstruction is immaculately good.</p> <p>Anyway, while looking at the oscilloscope traces on our tenth or twentieth rewatch, we started noticing a kind of pattern, where you start with relatively strong modulation and ease it off as the note plays. Which, like, most FM synth knowers surely knew, but we figured it out from here.</p> <p>...so, when we needed an FM bass, that's what we did. And it turned out to be a really aggressive sound, so we leaned into that aggression.</p> <p>Suggestions for playing with it:</p> <ul> <li>Try other waveforms.</li> <li>Change envelope parameters, FM mod amount, FM mod ratios. This is such a simple and artificial patch, you can change it a lot and keep its vibe.</li> <li>A weird one: switch FM mod VOL knob to <em> mode. You will likely need to activate 4x on the knob to get a similar effect, but FM mod VOL </em> mode means that changing volume with the bar at the top changes the timbre of the sound, and that's neat.</li> <li>Add shape distortion.</li> <li>Add echo.</li> <li>Add LFO tremolo or vibrato. We went really hard on these and thought that still sounded rad.</li> </ul> <h2>[22]=&quot;acid bass&quot;</h2> <p>(HS-53. Originally [10].)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--[[pod_type=&quot;instrument&quot;]]unpod(&quot;b64:bHo0AGgAAABmAAAA8Fd7aW5zdHJ1bWVudD1weHUAAygAAgAABAABEAYPFhABIAEgBQ8VD7DQAhACDyAQASAPIRABBQ86D-EBBA_ID_kBcAEIEAQPOA-CAUAPvvCrBA-lBvAFCfCvD-gKD-8PgA-3DQHwCH0=&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>A lot of these instruments were requests, and an acid bass was one of the first requests, and we were not confident at all.</p> <p>Fortunately, YouTube came through with <a href="https://www.youtube.com/watch?v=WTml_hD2Fno">@IhorMedia's video &quot;Techno Sound Design / 3 Analog Synth Bassline Techniques&quot;</a>, which (pleasingly) encouraged the viewer to follow along with their own (other) synthesizers.</p> <p>Clearly, there's a lot we can't do within our two-node and two-envelope limit, but the heart of the sound seems to be the massive resonance doing a massive cutoff sweep, so we gave it as much spice on top of that as we could. Not sure how to do the variations in timbre that are characteristic of the acid house style but it is at least a basic version of the sound.</p> <p>Suggestions for playing with it:</p> <ul> <li> <p>Stylistically, an acid bassline is typically played with rapid short repeated notes. There will be a way to do this in the tracker - setting a retriggering interval is in the roadmap - but for now, let's talk about looping envelopes.</p> <p>If you hit the &quot;...&quot; line at the bottom of an ADSR envelope, four boxes will appear: SPD, LP0, LP1, and T0. SPD=0 is a special value which loops at the SFX SPD. If you leave SPD and LP0 at 0 and set LP1 on ENV-1 to 1, it'll do the filter sweep every step. You can also have effects that happen less often by setting LP1 to a larger value. Finally, if you right- click on one of the white ears with an envelope number, you can make that repeat on the SFX clock instead of based on when you play the note.</p> <p>You can do some cool stuff with looping any kind of envelope, ADSR, LFO, or DATA. And it really fits this style of instrument and house music generally.</p> </li> <li>As usual, it's worth playing with knob values - in particular, the low-pass range start and end and ENV-1 attack have a lot of effect.</li> <li>A little bit of echo can be quite nice.</li> <li>Adding a sine wave oscillator outside the filter can thicken the sound.</li> </ul> <h2>[23]=&quot;64ish pulse&quot;</h2> <p>(HS-53. Originally [18].)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--[[pod_type=&quot;instrument&quot;]]unpod(&quot;b64:bHo0AGEAAABfAAAA8FB7aW5zdHJ1bWVudD1weHUAAygAAgAABAABEAYPGBABIAEgBQ8ZD_IBwAIQAg8gEAEgDyEgARABBA-gD8CAAQgQBAgPVPCyDy0PiQSwAaAK8KwP_AoP-w_AD-cNAfAIfQ==&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Back in 2017, <a href="https://bedroomproducersblog.com/2012/03/13/commodore-64-synthesizer-sessions-part-1-free-sample-pack/">Tomislav Zlatic sampled some Commodore 64s to produce some sample packs</a> and described &quot;the most famous SID lead sound&quot; as using pulse width modulation and fast vibrato. So, when we were asked to make some SID-ish sounds and found this post, that plus some low-pass (the SID had low-pass filters) was our core concept for our first SID-inspired patch. We improvised some melodies as we tweaked values until we thought it hit right and then we added it.</p> <p>Suggestions for playing with it:</p> <ul> <li>Mess around with envelope parameters.</li> <li>Mess around with waveform.</li> <li>Possibly add echo? It sounds all right here.</li> <li>Add tremolo using an LFO on the oscillator VOL knob.</li> </ul> <h2>[24]=&quot;bleepbloop&quot;</h2> <p>(HS-53. Originally [19].)</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--[[pod_type=&quot;instrument&quot;]]unpod(&quot;b64:bHo0AFcAAABVAAAA8EZ7aW5zdHJ1bWVudD1weHUAAygAAgAABAABEAYPIBABIAEgAfAAAhAGDg8qESAPJQwAETAPQQ8o8MIPLAADsAIAA0AP--CwD-gKD-8PgA-3Dw0B8Ah9&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>The same musician who asked about SID stuff shared a video of someone using a different SID-based plugin, so we poked around in that one and found this very simple patch fit in. It is literally just a triangle with a data envelope so it starts up an octave before it jumps down to the main note. A basic patch to end on, but it is unquestionably a chiptune sound if you like chiptune sounds.</p> <p>Suggestions for playing with it:</p> <ul> <li>Change waveform.</li> <li>Change envelope values.</li> <li>Set LP1 on the DATA envelope to something to make the blooping repeat in an octave arp pattern.</li> <li>Apply LP1 to the waveform to make the octave-up part a different timbre.</li> <li>Modify the waveform, e.g. with FM.</li> </ul> <p></div></div></div></p> <h1>Index</h1> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"></p> <h2>Oscillators</h2> <p>One Oscillator, Bare:</p> <ul> <li>[24]=&quot;bleepbloop&quot;</li> </ul> <p>One With Filter:</p> <ul> <li>[01]=&quot;tom&quot;</li> <li>[02]=&quot;snare&quot;</li> <li>[03]=&quot;hi hat&quot;</li> <li>[04]=&quot;crash cymbal&quot;</li> <li>[13]=&quot;violin&quot;</li> <li>[14]=&quot;harp&quot;</li> <li>[19]=&quot;trumpet&quot;</li> <li>[20]=&quot;synth bass&quot;</li> <li>[22]=&quot;acid bass&quot;</li> <li>[23]=&quot;64ish pulse&quot;</li> </ul> <p>One With Echo:</p> <ul> <li>[06]=&quot;celesta&quot;</li> <li>[08]=&quot;glass pad&quot;</li> </ul> <p>One With Shape:</p> <ul> <li>[00]=&quot;kick&quot;</li> <li>[12]=&quot;e guitar&quot;</li> </ul> <p>Two-Oscillator Additive:</p> <ul> <li>[09]=&quot;piano&quot;</li> <li>[10]=&quot;shamisen&quot;</li> <li>[17]=&quot;organ&quot;</li> </ul> <p>Ring Modulation:</p> <ul> <li>[15]=&quot;pipe&quot;</li> </ul> <p>FM Modulation:</p> <ul> <li>[05]=&quot;marimba&quot;</li> <li>[07]=&quot;steelpan&quot;</li> <li>[11]=&quot;guitar&quot;</li> <li>[16]=&quot;flute&quot;</li> <li>[18]=&quot;oboe&quot;</li> <li>[21]=&quot;fm bass&quot;</li> </ul> <h2>Envelopes</h2> <p>One ADSR:</p> <ul> <li>[00]=&quot;kick&quot;</li> <li>[02]=&quot;snare&quot;</li> <li>[03]=&quot;hi hat&quot;</li> <li>[04]=&quot;crash cymbal&quot;</li> <li>[08]=&quot;glass pad&quot;</li> <li>[16]=&quot;flute&quot;</li> <li>[19]=&quot;trumpet&quot;</li> <li>[21]=&quot;fm bass&quot;</li> </ul> <p>Two ADSR:</p> <ul> <li>[01]=&quot;tom&quot;</li> <li>[05]=&quot;marimba&quot;</li> <li>[07]=&quot;steelpan&quot;</li> <li>[09]=&quot;piano&quot;</li> <li>[10]=&quot;shamisen&quot;</li> <li>[11]=&quot;guitar&quot;</li> <li>[12]=&quot;e guitar&quot;</li> <li>[14]=&quot;harp&quot;</li> <li>[20]=&quot;synth bass&quot;</li> <li>[22]=&quot;acid bass&quot;</li> </ul> <p>ADSR + LFO:</p> <ul> <li>[06]=&quot;celesta&quot;</li> <li>[13]=&quot;violin&quot;</li> <li>[15]=&quot;pipe&quot;</li> <li>[17]=&quot;organ&quot;</li> <li>[23]=&quot;64ish pulse&quot;</li> </ul> <p>ADSR + Data:</p> <ul> <li>[18]=&quot;oboe&quot;</li> <li>[24]=&quot;bleepbloop&quot;</li> </ul> <h2>Wavetables</h2> <p>Single WT-0:</p> <ul> <li>[00]=&quot;kick&quot;</li> <li>[01]=&quot;tom&quot;</li> <li>[06]=&quot;celesta&quot;</li> <li>[08]=&quot;glass pad&quot;</li> <li>[12]=&quot;e guitar&quot;</li> <li>[13]=&quot;violin&quot;</li> <li>[14]=&quot;harp&quot;</li> <li>[19]=&quot;trumpet&quot;</li> <li>[20]=&quot;synth bass&quot;</li> <li>[22]=&quot;acid bass&quot;</li> <li>[23]=&quot;64ish pulse&quot;</li> <li>[24]=&quot;bleepbloop&quot;</li> </ul> <p>Dual WT-0:</p> <ul> <li>[05]=&quot;marimba&quot;</li> <li>[07]=&quot;steelpan&quot;</li> <li>[09]=&quot;piano&quot;</li> <li>[11]=&quot;guitar&quot;</li> <li>[15]=&quot;pipe&quot;</li> <li>[16]=&quot;flute&quot;</li> <li>[17]=&quot;organ&quot;</li> <li>[18]=&quot;oboe&quot;</li> <li>[21]=&quot;fm bass&quot;</li> </ul> <p>WT-0 and WT-1:</p> <ul> <li>[10]=&quot;shamisen&quot;</li> </ul> <p>WT-1 only:</p> <ul> <li>[02]=&quot;snare&quot;</li> <li>[03]=&quot;hi hat&quot;</li> <li>[04]=&quot;crash cymbal&quot;</li> </ul> <h2>/ 4</h2> <ul> <li>[00]=&quot;kick&quot;</li> </ul> <h2>x 4</h2> <ul> <li>[12]=&quot;e guitar&quot;</li> <li>[16]=&quot;flute&quot;</li> </ul> <h2>R</h2> <ul> <li>[03]=&quot;hi hat&quot;</li> </ul> <p></div></div></div></p> https://www.lexaloffle.com/bbs/?tid=142098 https://www.lexaloffle.com/bbs/?tid=142098 Fri, 03 May 2024 15:30:52 UTC Feature request: rearranging nodes in instrument definitions <p>Been playing with modifying Picotron instruments, and sometimes we'd like to add a second carrier oscillator to an existing one while feeding it through the same filter/echo/shape effect. Right now, the only way to do that is to remake the effect manually after the new oscillator and then delete the old one.</p> https://www.lexaloffle.com/bbs/?tid=141977 https://www.lexaloffle.com/bbs/?tid=141977 Fri, 26 Apr 2024 14:52:01 UTC [no workspaces] screen on boot (v0.1.0f) <img style="margin-bottom:16px" border=0 src="/media/40166/2024-04-16 13-49-16--Picotron bug snapshot.png" alt="" /> <p>On boot (running NixOS 23.11 with KDE Plasma version 5.27.10) it shows a green &quot;no workspaces&quot; screen with a weird cursor glitch and the SFX workspace icon replaced with a desktop one ... until we click another workspace, at which point everything is fixed.</p> <p>Edit: GIF of bug:<br /> <div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"></p> <img style="margin-bottom:16px" border=0 src="/media/40166/2024-04-16t13-49-16-picotron-noworkspacesbug-30fps.gif" alt="" /> <p></div></div></div></p> <p>Edit 2: Seems fixed for us in v0.1.0g - ping us if you're still getting it and we'll unresolve the issue.</p> https://www.lexaloffle.com/bbs/?tid=141769 https://www.lexaloffle.com/bbs/?tid=141769 Tue, 16 Apr 2024 17:46:00 UTC Feature request: 'modwheel' mapping <p>One feature of electronic music is varying instrument parameters during the performance - for example, adjusting the depth of the lowpass filter sweep on an acid bassline. I think if there were a way to specify in the instrument design that one (or more) knobs was mapped to a value controlled by the tracker, it would be very easy to do these kinds of musical manipulations.</p> https://www.lexaloffle.com/bbs/?tid=141717 https://www.lexaloffle.com/bbs/?tid=141717 Sun, 14 Apr 2024 12:13:32 UTC The Packbats' 2-node Instrument Collection <p> <table><tr><td> <a href="/bbs/?pid=146304#p"> <img src="/bbs/thumbs/pico64_packbats_2node-3.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=146304#p"> packbats_2node</a><br><br> by <a href="/bbs/?uid=40166"> packbat</a> <br><br><br> <a href="/bbs/?pid=146304#p"> [Click to Play]</a> </td></tr></table> </p> <p><a href="https://www.lexaloffle.com/bbs/?tid=141544">As previously threatened</a>, we have created a collection of simple (1-2 nodes, 1-2 envelopes) Picotron instrument patches for anyone to use in their programs. All of the instrument patches are released as <a href="https://creativecommons.org/publicdomain/zero/1.0/">CC-0 public domain</a> - you are free to use, modify, and sell without credit. (Although we would appreciate credit if you do make something with it as long as the thing is not, like, evil or bigoted - Nazis, TERFs, and channers, go away.)</p> <p>With the 1.0 release, there are 25 instruments (<a href="https://www.lexaloffle.com/bbs/files/40166/2node-v1.mp3">mp3 preview</a>), sorted into five categories:</p> <p><strong>Drum Kit</strong></p> <ul> <li>kick</li> <li>tom</li> <li>snare</li> <li>hi hat</li> <li>crash cymbal</li> </ul> <p><strong>Pitched Idiophones</strong></p> <ul> <li>marimba</li> <li>celesta</li> <li>steelpan</li> <li>glass pad</li> </ul> <p><strong>Chordophones</strong></p> <ul> <li>piano</li> <li>shamisen</li> <li>guitar</li> <li>e guitar</li> <li>violin*</li> <li>harp</li> </ul> <p><strong>Aerophones</strong></p> <ul> <li>pipe</li> <li>flute</li> <li>organ</li> <li>oboe*</li> <li>trumpet</li> </ul> <p><strong>Electrophones</strong></p> <ul> <li>synth bass</li> <li>fm bass</li> <li>acid bass</li> <li>64ish pulse</li> <li>bleepbloop</li> </ul> <p>Directions for use are simple: use the scrollbar or mousewheel to navigate the list, click the name of the instrument to get a short preview, and click &quot;copy&quot; to put the data on your clipboard for pasting into sfx.p64's instrument editor. The volumes are roughly (by ear) matched to the default triangle wave instrument to aid in mixing.</p> <p><strong>* Technical note:</strong> the violin and oboe instruments will not preview correctly in the instrument editor, as ENV 1 on each uses a special 0 value on FREQ and SPD, respectively. With this setting, the vibrato of each of these will be synchronized with the SPD of the SFX in which they are used. To change this, simply change this value in the righthand column.</p> <p><strong>P.S.</strong> <a href="https://www.lexaloffle.com/bbs/?tid=142098">A commentary track elaborating on the design of each instrument</a> is now out for anyone interested! It has a lot of info, including a random personal anecdote about the Chemical Plant Zone music from Sonic 2!</p> <p>Old post text:<br /> <div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><a href="https://www.lexaloffle.com/bbs/?tid=141544">As previously threatened</a>, we have created a collection of simple (1-2 nodes, 1-2 envelopes) Picotron instrument patches for anyone to use in their programs. All of the instrument patches are released as <a href="https://creativecommons.org/publicdomain/zero/1.0/">CC-0 public domain</a> - you are free to use, modify, and sell without credit. (Although we would appreciate credit if you do make something with it as long as the thing is not, like, evil or bigoted - Nazis, TERFs, and channers, go away.)</p> <p>Directions for use are simple: use the scrollbar or mousewheel to navigate the list, click the name of the instrument to get a short preview, and click &quot;copy&quot; to put the data on your clipboard for pasting into sfx.p64's instrument editor.</p> <p>Planned for 1.0:</p> <ul> <li>five more instrument patches (thanks to everyone who's made suggestions so far!)</li> <li>a list that's sorted in a way that makes sense instead of being a total jumble</li> </ul> <p>Edit: Small update to add the marimba - current instrument list:</p> <ul> <li>piano</li> <li>violin</li> <li>pipe</li> <li>organ</li> <li>kick</li> <li>snare</li> <li>hi hat</li> <li>crash cymbal</li> <li>synth bass</li> <li>fm bass</li> <li>acid bass</li> <li>glass pad</li> <li>guitar</li> <li>trumpet</li> <li>celesta</li> <li>flute</li> <li>e guitar</li> <li>shamisen</li> <li>64ish pulse</li> <li>bleepbloop</li> <li>marimba</li> </ul> <p>Edit 2:</p> <ul> <li>harp</li> <li>oboe<br /> </div></div></div></li> </ul> https://www.lexaloffle.com/bbs/?tid=141626 https://www.lexaloffle.com/bbs/?tid=141626 Wed, 10 Apr 2024 18:37:35 UTC Picotron synth fan presets? <p>Thinking about putting together a collection of free instruments for the community - simple stuff with one or two nodes and one or two envelopes, like this:</p> <img style="margin-bottom:16px" border=0 src="/media/40166/Picotron-Synth-Screenshot_20240408_092710.png" alt="" /> <p>...so as to leave a lot of room for modification by users.</p> <p><strong>What instruments would y'all want in a free patch collection?</strong> Right now we have crude versions of:</p> <ul> <li>violin</li> <li>piano</li> <li>pipe</li> <li>organ</li> <li>kick</li> <li>snare</li> <li>hat</li> <li>crash</li> </ul> <p>but a single .sfx file can hold up to 24 instruments, so it feels like we should offer more than eight.</p> <p>edit: <a href="https://www.lexaloffle.com/bbs/?tid=141626">instrument collection cart!</a></p> https://www.lexaloffle.com/bbs/?tid=141544 https://www.lexaloffle.com/bbs/?tid=141544 Mon, 08 Apr 2024 13:18:29 UTC Picotron instrument design rudiments (latest version: 2.0) <p>Over a week or so in late March and early April, we've been working on instrument.txt - a detailed (~4.6k words) guide to Picotron's built-in instrument editor, designed for musicians who have Picotron but know nothing about synthesizer sound design. In <a href="/media/40166/instrument_2.txt">this guide (currently version 2.0)</a> (<a href="/media/40166/instrument.txt.html">html version</a>, <a href="https://packbat.neocities.org/instrument-txt">web version</a>), we:</p> <ul> <li>Detail the Picotron instrument editor UI;</li> <li>Explain how each element - output mixer, oscillators, envelopes, and effects - works; and</li> <li>Guide you through putting this to practice by making a series of simple instruments, including organ sounds, 'piano' sounds, kick drums, snare(-adjacent) drums, and cymbals and hi hats.</li> </ul> <p>If you've been wanting to play with Picotron's tracker but not known how to make it work, we hope this sets you up to make lots of sounds.</p> <h2>Changelog</h2> <p><a href="/media/40166/instrument_2.txt">2.0:</a></p> <ul> <li>added info on the space bar halt-sound control and the random and looping envelope options.</li> <li>clarifications of wording throughout, notably including ADSR values in Exercise 1 and a full rewrite of the &quot;Simple Piano&quot; exercise</li> <li>corrections to a few errors (e.g. to change wavetable, you have to click the WT-# label specifically)</li> </ul> <p><a href="/media/40166/instrument.txt">1.2:</a></p> <ul> <li>initial public release</li> </ul> https://www.lexaloffle.com/bbs/?tid=141467 https://www.lexaloffle.com/bbs/?tid=141467 Fri, 05 Apr 2024 16:15:56 UTC three speed (free BGM loop) <p> <table><tr><td> <a href="/bbs/?pid=145074#p"> <img src="/bbs/thumbs/pico64_threespeed_bgm-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=145074#p"> threespeed_bgm</a><br><br> by <a href="/bbs/?uid=40166"> packbat</a> <br><br><br> <a href="/bbs/?pid=145074#p"> [Click to Play]</a> </td></tr></table> </p> <p>Been experimenting to get the hang of the synth, and we figured we'd donate some of the fruits of that experimentation to the community. Two channels, eight music patterns, six SFX, four instruments, <a href="https://creativecommons.org/licenses/by-nc/4.0/">CC BY-NC 4.0</a>. Would love to hear if y'all use it (or its instrument designs) for anything.</p> https://www.lexaloffle.com/bbs/?tid=141261 https://www.lexaloffle.com/bbs/?tid=141261 Sat, 30 Mar 2024 04:10:04 UTC Laser Rot (Free Music Jam submission) <p> <table><tr><td> <a href="/bbs/?pid=141904#p"> <img src="/bbs/thumbs/pico8_packbats_laser_rot-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=141904#p"> packbats_laser_rot</a><br><br> by <a href="/bbs/?uid=40166"> packbat</a> <br><br><br> <a href="/bbs/?pid=141904#p"> [Click to Play]</a> </td></tr></table> </p> <p>This PICO-8 chiptune was composed for <a href="https://itch.io/jam/pico-8-free-music-jam">the 2024 PICO-8 Free Music Jam</a>. It uses three channels - bass and bass percussion on channel 0, melody and mid percussion on channel 1, and high percussion on channel 2 - and requires 16 SFX and 24 music patterns, no custom SFX instruments. The full loop is approximately 1 minute 16 seconds long. You can probably interrupt the high percussion on channel 2 if you need a second channel for sound effects.</p> <p>This piece of music is being released under a <a href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons Attribution-ShareAlike 4.0 license</a>. Visualizers are provided by <a href="https://www.lexaloffle.com/bbs/?tid=140061">Bikibird's album cart</a>. The cover art is based on the image <a href="https://commons.wikimedia.org/wiki/File:Time_destroyed_CD.JPG">&quot;Time destroyed CD&quot; by Bernd Hutschenreuther</a>, used under a <a href="https://creativecommons.org/licenses/by-sa/3.0/deed.en">Creative Commons Attribution-ShareAlike 3.0 license</a>, and processed with <a href="https://imagemagick.org/">ImageMagick</a> and <a href="https://bikibird.itch.io/depict">Depict</a>.</p> https://www.lexaloffle.com/bbs/?tid=140354 https://www.lexaloffle.com/bbs/?tid=140354 Sun, 25 Feb 2024 02:22:35 UTC &quot;Cuban Cake Walk&quot; by James Timothy Brymn <p> <table><tr><td> <a href="/bbs/?pid=141167#p"> <img src="/bbs/thumbs/pico8_cubancakewalk_brymn-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=141167#p"> cubancakewalk_brymn</a><br><br> by <a href="/bbs/?uid=40166"> packbat</a> <br><br><br> <a href="/bbs/?pid=141167#p"> [Click to Play]</a> </td></tr></table> </p> <p>This cart, which uses one of <a href="https://www.lexaloffle.com/bbs/?uid=49583"> @bikibird</a>'s visualizers provided courtesy of <a href="https://itch.io/jam/pico-8-free-music-jam">the PICO-8 Free Music Jam</a> (in a beta version, as a co-organizer we helped with testing), contains an arrangement of the music of someone we'd never heard of: <a href="https://imslp.org/wiki/Cuban_Cake_Walk_%28Brymn%2C_James_Timothy%29">James Timothy Brymn's &quot;Cuban Cake Walk&quot;</a>.</p> <p>And that's a shame, because (a) Lieutenant James Tim Brymn was apparently an absolutely legendary Black American arranger, composer, and bandleader, one of the people who helped give birth to jazz as we know it today, and (b) while we didn't manage to include the entire composition in this, &quot;Cuban Cake Walk&quot; is a delightful piece of music with a really fun bouncy groove. And if we hadn't clicked on the IMSLP website on a day when it was being featured, we'd know none of this.</p> <p>So, tossing this up for all y'all, declaring my arrangement to be public domain, feel free to drop this in anything that needs it. The melody and bass line are in channels 0 and 1, main harmony in channel 2, and occasional supplemental harmony in channel 3; we would restrict game SFX to channels 2 and 3 personally.</p> https://www.lexaloffle.com/bbs/?tid=140105 https://www.lexaloffle.com/bbs/?tid=140105 Mon, 05 Feb 2024 20:26:24 UTC &quot;no ending&quot; (2-channel BGM loop) <p> <table><tr><td> <a href="/bbs/?pid=140937#p"> <img src="/bbs/thumbs/pico8_noending_by_packbats-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=140937#p"> noending_by_packbats</a><br><br> by <a href="/bbs/?uid=40166"> packbat</a> <br><br><br> <a href="/bbs/?pid=140937#p"> [Click to Play]</a> </td></tr></table> </p> <p>Someone randomly mentioned Minecraft on the official unofficial Discord, and with <a href="https://itch.io/jam/pico-8-free-music-jam">the PICO-8 Free Music Jam</a> starting tomorrow (plug!), that inspired this chill but slightly dissonant background loop. Approximately two and a quarter minutes long, uses 00, 01, and 02 for custom SFX instruments, total of 15 SFX and 16 patterns.</p> <p>Music is <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC-BY-NC-SA 4.0</a>, art is <a href="https://flickr.com/photos/reedexter/2405683888/">&quot;Twilight&quot; by RDexter on Flickr</a>, <a href="https://creativecommons.org/licenses/by-nc/2.0/">CC-BY-NC 2.0</a>.</p> https://www.lexaloffle.com/bbs/?tid=140051 https://www.lexaloffle.com/bbs/?tid=140051 Wed, 31 Jan 2024 16:53:00 UTC tanh soft clipping for PCM <p>One of the basic problems you might want to solve in doing PCM synthesis is limiting a signal to the range between -1 and +1. Obviously you can just use a mid() function to get hard clipping - the value just locks to the endpoints - but this often has unpleasant side effects. For example, if you hard clip the output, the sound will snap abruptly from smooth to harsh as the volume increases, with very little transition between these. So, people often want to round off that transition, let the sound get gradually harsher, and one of the smoothest options is to use the tanh - hyperbolic tangent - function. Looking at <a href="https://commons.wikimedia.org/wiki/File:Hyperbolic_Tangent.svg">a graph of this function</a>, you can see that it smoothly transitions from reproducing the original x value to squishing it between -1 and 1, just as we often want.</p> <p>So, I did a bit of experimenting today with sine waves and came up with the following code snippet:</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--to use table: -- tanh = lut[x\0x.01] or sgn(x) function lut_tanh() --lookup table of tanh -- between -3 and +3 -- with step size 1/256 local tanh={} for i_x=-768,768 do --naive formula is --tanh = 1 - 2/(1+exp(2x)) local x=i_x&gt;&gt;8 --=i_x*0x.01 --inspired by https://www.math.utah.edu/~beebe/software/ieee/tanh.pdf formula: --1. from 0 to x_small=0x0.01bb, tanh(x) = x --2. for x&gt;=0x5.3300, naive formula returns 1 if abs(x)&lt;=0x.01bb then tanh[i_x]=x else tanh[i_x]=1-2/(1+0x2.b7e1^(2*x)) end end return tanh end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>To my ears, with these values, driving a sine wave with an input volume as low as 0.03 sounds only about as bad as the original sine wave does with so few bits to work with, and driving all the way up to 16 there's not a lot of artifacting to the distortion. With some antialiasing you could probably do even better than that.</p> <p>This function uses 1537 entries in the lookup table, which I think is about 1.4% of Lua memory. I know my ears aren't very trained when it comes to analyzing synth sounds, so feel free to edit this if it seems like too much or not enough, but it seems to me like a fairly practical compromise for PCM slingers.</p> https://www.lexaloffle.com/bbs/?tid=139823 https://www.lexaloffle.com/bbs/?tid=139823 Sat, 13 Jan 2024 19:25:50 UTC PICO-8 Free Music Jam <p>Oh hey, a thing we're doing is live!</p> <p><a href="https://itch.io/jam/pico-8-free-music-jam"><img style="margin-bottom:16px" border=0 src="/media/40166/pico 8 free music jam cover by parak00pa.png" alt="" /></a></p> <p><a href="https://itch.io/jam/pico-8-free-music-jam">The PICO-8 Free Music Jam</a> is an itch.io jam for musicians with a very simple concept: PICO-8 devs want music to put in their carts, we're gonna make music for their carts.</p> <p>It'll be running for the full month of February - no ratings, no competition, just music for PICO-8. And if you wanna get started making music, in PICO-8 or at all, there's loads of resources linked on the jam page.</p> <p>(edit: And many thanks to the folks in the #music-sfx channel of the official unofficial PICO-8 Discord who came together to hatch this idea and hammer out the details, and to <a href="https://www.lexaloffle.com/bbs/?uid=55005"> @paraK00PA</a> for the awesome cover art!)</p> https://www.lexaloffle.com/bbs/?tid=55621 https://www.lexaloffle.com/bbs/?tid=55621 Thu, 04 Jan 2024 16:21:41 UTC Random PICO-8 top tips thread <p>I don't know if this exists, but I think it would be cool to have a thread of Stuff You Might Not Have Figured Out From Just Messing Around Making Things.</p> <p>Here's two to start with, from a musician perspective:</p> <ol> <li> <p><strong>If you can, leave SFX 00 through 07 empty.</strong> It will help with adding music later - be that you adding music or because those slots can be used for custom SFX instruments that give a lot of character and flavor to compositions.</p> </li> <li><strong>Decide how many channels to reserve for music.</strong> The 4 SFX channels of PICO-8 have to be used by both music and sound effects, and both music and sound effects benefit from having more channels - so think about which is more important to you, and which sound effects can interrupt each other. You can also, if some sound effects are only played sparsely (maybe you have a clicky sound while navigating menus!), try having one channel of music that is interrupted briefly by the sparse effect and then resumes.</li> </ol> https://www.lexaloffle.com/bbs/?tid=53452 https://www.lexaloffle.com/bbs/?tid=53452 Tue, 18 Jul 2023 15:57:56 UTC midi 046 Concert Harp <p> <iframe src="sfxp2.php?id=40166_27" width="402" height="300" style="border:none; overflow:hidden" scrolling="no" allow="autoplay"></iframe><a style="cursor:pointer; font-size:8pt" onclick=' var el = document.getElementById("sfxcode_40166_27"); if (el.style.display == "none") el.style.display = ""; else el.style.display = "none"; microAjax("/bbs/sfxc/40166_27.txt", function (retdata){ var el = document.getElementById("sfxcode_40166_27"); el.innerHTML = retdata; el.focus(); el.select(); } ); '> [sfx] </a> <textarea rows=3 class=lexinput id="sfxcode_40166_27" style="width:480px;background-color:#fed;display:none;overflow:hidden; font-size:4pt;"></textarea> </p> <p>Was listening to some old compositions of mine and realized that I had a nice little instrument that hadn't made it into the midi library!</p> <p>For the demo, I used the same trick I used then, and split the melody across two separate SFX so the tails of each note could ring out while the next note played. Bit of a faff to do, but it produces a very good effect.</p> <p> <table><tr><td> <a href="/bbs/?pid=126381#p"> <img src="/bbs/thumbs/pico8_hifesosani-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=126381#p"> hifesosani</a><br><br> by <a href="/bbs/?uid=40166"> packbat</a> <br><br><br> <a href="/bbs/?pid=126381#p"> [Click to Play]</a> </td></tr></table> </p> <p>As noted in the cart, at least to me, it still sounds good and has a harp-ish vibe with various combinations of Buzz, Dampen, and Reverb; Detune doesn't work because the bulk of the SFX is the triangle wave.</p> https://www.lexaloffle.com/bbs/?tid=51783 https://www.lexaloffle.com/bbs/?tid=51783 Mon, 27 Feb 2023 20:30:48 UTC State Variable Filter for PCM <p>So, let's say you're building a synthesizer using the serial PCM output and you want a filter. What do?</p> <p>Well, what I did was follow a link <a href="https://www.lexaloffle.com/bbs/?uid=24137"> @luchak</a> posted a while ago in the Discord to <a href="https://www.musicdsp.org/en/latest/Filters/92-state-variable-filter-double-sampled-stable.html">this SVF filter design by Andrew Simper, Laurent de Soras, and Steffan Diedrichsen</a>. And then get blasted with noise, because a design that works great with double-precision floating-point numbers is not so great with 16b.16b fixed-point PICO-8 numbers.</p> <p><em>Edit: I recommend using the <a href="https://www.lexaloffle.com/bbs/?pid=126689#p">code snippet downthread</a> rather than this one.</em></p> <p>Now, I'm not good enough at math to prove mathematically that this is stable, but I'm good enough at hacking together testing code to feel confident that, as long as:</p> <ul> <li>the signal being fed into the filter remains in the range -1 to 1,</li> <li>the resonance remains in the range 0 to 1, and</li> <li>the cutoff remains in the range 0 to 2756.25 (the Nyquist frequency for PICO-8's 5512.5 Hz PCM output)</li> </ul> <p>...this should produce an output that remains within the range <del>-3 to 3</del> -3.5 to 3.5 and is usable.</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--this is the initialization section; do it outside the sample calculation loop local f_low,f_band=0,0 --these are the filter parameters --I haven't tested changing them while the filter is running but that's what I plan to do, so, here's hoping. local res=0 to 1 local freq=-2.0*sin(cutoff frequency/22050)--sin( 0.5 * cutoff frequency/(2*sampling frequency) ) --after you set freq and res, these two are derived local drive=max(0,.05*res-.0125)--0 for res&lt;0.25, increase linearly to 0.0375 for res=1 local damp=min(2.0*(1.0 - res^0.25), min(2.0, 2.0/freq - freq*0.5)) -- -- -- do the calculations here to generate osc, your signal to be filtered -- -- --2x oversampled filter local f_notch=osc-damp*f_band f_low+=freq*f_band local f_high=f_notch-f_low f_band-=drive*f_band*f_band*f_band--distortion f_band+=freq*f_high--filter local out=(f_notch or f_low or f_high or f_band)&gt;&gt;1--half here... f_notch=osc-damp*f_band f_low+=freq*f_band f_high=f_notch-f_low f_band-=drive*f_band*f_band*f_band--distortion f_band+=freq*f_high--filter out+=(f_notch or f_low or f_high or f_band)&gt;&gt;1--...and half here</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>To show it off, here's my current very incomplete version of a button keyboard cart. Same keyboard keys as you use for SFX editor note entry; left-right arrows to change octave. This filter is set up with a cutoff frequency of A5 (880 Hz) and a resonance of 1.<br /> <table><tr><td> <a href="/bbs/?pid=124936#p"> <img src="/bbs/thumbs/pico8_pb_pcmk_filter_demo-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=124936#p"> pb_pcmk_filter_demo</a><br><br> by <a href="/bbs/?uid=40166"> packbat</a> <br><br><br> <a href="/bbs/?pid=124936#p"> [Click to Play]</a> </td></tr></table> </p> https://www.lexaloffle.com/bbs/?tid=51387 https://www.lexaloffle.com/bbs/?tid=51387 Sat, 28 Jan 2023 03:25:33 UTC PCM synth for cart background music: hard but possible? <p>I think ever since <a href="https://www.lexaloffle.com/bbs/?uid=23375"> @carlc27843</a>'s <a href="https://www.lexaloffle.com/bbs/?tid=41991">Impossible Mission R.T.</a> cart came out, people have been wondering if they could make background music for a cart using PCM synthesis. carlc27843's <a href="https://www.lexaloffle.com/bbs/?tid=42362">Emulated Amstrad CPC Chiptunes</a> post discusses using its engine that way, <a href="https://www.lexaloffle.com/bbs/?uid=24137"> @luchak</a> has had to let people know that the <a href="https://www.lexaloffle.com/bbs/?tid=47284">RP-8</a> groovebox <em>can't</em> be used that way ... folks are curious.</p> <p>I don't know a lot about digital audio synthesis, but from the conversations that have happened in the PICO-8 Discord, it sounds like there's roughly three sides to the equation:</p> <h3>Cost</h3> <ul> <li><strong>How many tokens and bytes are cart designers willing to give up to the soundtrack?</strong> <a href="https://www.lexaloffle.com/bbs/?uid=49583"> @bikibird</a>'s <a href="https://www.lexaloffle.com/bbs/?tid=49108">Speako8 Speech Synthesis Library</a> is under a thousand tokens - is that a good target?</li> <li><strong>What percentage of PICO-8's CPU budget?</strong> Four voices with 25% CPU seems possible in a few different ways, but is that too much to give up to background music?</li> <li><strong>How much memory, Lua and addressable?</strong> Most forms of synthesis probably run out of CPU first, but this could be a question if you're making a lot of lookup tables.</li> </ul> <h3>Usability</h3> <ul> <li><strong>How do you program tracks?</strong> Does it use PICO-8's built-in tracker with its own sound sources? Does it have a custom editor?</li> <li><strong>How do you add them to your games?</strong> Presumably you copy a bunch of code into memory and add a function or coroutine to your game loop, but where and how do you store tracks?</li> </ul> <h3>Quality</h3> <ul> <li><strong>How many simultaneous voices?</strong> PICO-8's built-in tracker allows 4 simultaneous sounds, but most game BGM is built with 2 or 3.</li> <li><strong>What effects can you add?</strong> Reverb is probably out of budget, but echo is possible (if memory-expensive), and distortion and compression are totally feasible. As are filters - certainly low pass, high pass, band pass, and notch.</li> <li><strong>What kind of synth do you make?</strong></li> </ul> <p>It's definitely possible to make:</p> <ul> <li>Simple waveform synthesis (e.g. sine, square/pulse, sawtooth, triangle)</li> <li>FM synthesis</li> <li>Sample-based synthesis (very storage-expensive!)</li> <li>Wavetable synthesis (the original PPG Wave synthesizers only had 8-bit samples! but this is also storage-expensive, if less than sample-based synthesis)</li> <li>Subtractive synthesis with any of the above as oscillators</li> </ul> <p>...but the more processing you do, the more sound design tools you add, the more expensive your result will be.</p> <h3>Conclusion?</h3> <p>I don't really have one? But I think it would be good to have a space on the official forums where people who are thinking about this stuff can talk about it. I haven't made a lot of games, so I don't know what what a good budget would be for game developers ... and I haven't made much music with much outside PICO-8 and, like, an actual piano, so I don't know what a good synthesizer would be for game soundtrack composers. And I know barely anything about software synthesis, so I don't know what's possible, what's easy, what's hard, or why my low-pass filter makes hell noises if I give it the wrong parameters.</p> <p>I think it would be cool to share knowledge, and the forums seems like the best place to do it.</p> https://www.lexaloffle.com/bbs/?tid=51246 https://www.lexaloffle.com/bbs/?tid=51246 Wed, 18 Jan 2023 18:45:26 UTC line()-based Cubic Bezier Curve <p> <table><tr><td> <a href="/bbs/?pid=122890#p"> <img src="/bbs/thumbs/pico8_pb_line_cbez-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=122890#p"> pb_line_cbez</a><br><br> by <a href="/bbs/?uid=40166"> packbat</a> <br><br><br> <a href="/bbs/?pid=122890#p"> [Click to Play]</a> </td></tr></table> </p> <p>I know a lot of people have posted functions for drawing cubic bezier curves, but I'm tossing my own into the pot because why not. Just skimming threads, it feels like most people use pset() to draw them pixel by pixel; this one uses line() to draw them segment by segment.</p> <p>Some animated gifs, because they're fun:<br /> <div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> demo of the editor in the cart:</p> <img style="margin-bottom:16px" border=0 src="/media/40166/cbez0 7_7.gif" alt="" /> <p>drawing demo, dividing the curve into segments:</p> <img style="margin-bottom:16px" border=0 src="/media/40166/cbez0 7_6.gif" alt="" /> <p>drawing demo, dividing the curve dynamically based on pixel precision:</p> <img style="margin-bottom:16px" border=0 src="/media/40166/cbez0 7_5.gif" alt="" /> <p></div></div></div></p> <p>To save you digging into the cart, here's the two versions of the algorithm I'd recommend, based on my testing. If you want to see how fast they run, there's a pause menu item in the code that draws sets of 5000 random bezier curves with a bunch of different algorithm parameters in two sizes - 16-pixel square bounding box and 128-pixel square bounding box - and adds up the total CPU needed at 60 FPS.</p> <ol> <li> <p>The polynomial coefficients function. All of the other code uses this.</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--coefficient fn (39 tokens, shared by all) function cubic_coef(p0,p1,p2,p3) --coefs for cubic bezier return p0, -3*p0+3*p1, 3*p0-6*p1+3*p2, -p0+3*p1-3*p2+p3 end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> </li> <li> <p>Fixed-segments option. This one has 16 segments, which (a) is convenient numerically and (b) doesn't get too messy for small curves but doesn't look too chunky for large ones. From the benchmark, you could draw 220 big curves or 250 small curves in one 60 FPS frame.</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--fixed 16 points (+80 tokens) function cbez_16(x0,y0,x1,y1,x2,y2,x3,y3) --cubic bez, dt predefined --precalculate polynomial coefs local a0,a1,a2,a3=cubic_coef(x0,x1,x2,x3) local b0,b1,b2,b3=cubic_coef(y0,y1,y2,y3) --set endpoint for first segment -- by poking ram with coords poke2(0x5f3c,x0) poke2(0x5f3e,y0) -- --optional: clear error to avoid bugs -- poke(0x5f35,0)--4 tokens for t=0x.1,1,0x.1 do line( a0+t*(a1+t*(a2+t*a3)), b0+t*(b1+t*(b2+t*b3)) ) end end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> </li> <li> <p>Adaptive-segments option. This one is a bit faster for small curves - like 320/frame - but much slower for large curves - like 110/frame.</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>--recursive, fixed 2px precision -- (+186 tokens) function cbez_recurs2(x0,y0,x1,y1,x2,y2,x3,y3) --cubic bez, adaptive points --precalculate polynomial coefs local a0,a1,a2,a3=cubic_coef(x0,x1,x2,x3) local b0,b1,b2,b3=cubic_coef(y0,y1,y2,y3) --set endpoint for first segment -- by poking ram with coords poke2(0x5f3c,x0) poke2(0x5f3e,y0) -- --optional: clear error to avoid bugs -- poke(0x5f35,0)--4 tokens --poly function local function xy(t) return a0+t*(a1+t*(a2+t*a3)), b0+t*(b1+t*(b2+t*b3)) end --subdividing draw function local function crawl(tp,tn,xp,xn,yp,yn) --draw curve recursively to tn local tm=(tp+tn)&gt;&gt;1 local xm,ym=xy(tm) --luchak fast abs local xerr,yerr=(xp+xn)&gt;&gt;1,(yp+yn)&gt;&gt;1 xerr-=xm yerr-=ym if xerr^^(xerr&gt;&gt;31)&gt;2 or yerr^^(yerr&gt;&gt;31)&gt;2 then --not precise enough; recurse crawl(tp,tm,xp,xm,yp,ym) crawl(tm,tn,xm,xn,ym,yn) else --close enough; draw line(xm,ym) line(xn,yn) end end local x5,y5=xy(.5) crawl(0,.5,x0,x5,y0,y5) crawl(.5,1,x5,x3,y5,y3) end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>(Shoutout to <a href="https://www.lexaloffle.com/bbs/?uid=24137"> @luchak</a>, from whom I swiped this fast abs function - I think it ended up reducing runtime by about 3%, which might not be worth it but hey.)</p> </li> </ol> <p>There's probably ways to optimize these further that I haven't thought of - I'm just not very good at that - so please feel free to sound off with any suggestions.</p> <p>Also, I tried to make good comments, but let me know if anything's unclear.</p> https://www.lexaloffle.com/bbs/?tid=50777 https://www.lexaloffle.com/bbs/?tid=50777 Fri, 23 Dec 2022 14:04:01 UTC extcmd(&quot;audio_rec&quot;) limit is 2 minutes, not 8 minutes (v0.2.5e) <p>Out of curiosity, I was testing to confirm that the new limit on length of audio recordings via extcmd(&quot;audio_rec&quot;) was per-instance and not per-session ... and discovered that the length of recording I got was 2 minutes instead of the 8 minutes listed in the v0.2.5d changelog.</p> <p>An 8-minute limit makes sense to me but a 2-minute one doesn't, so I'm assuming this is an error of some sort.</p> <p>edit: confirmed fixed in v0.2.5g.</p> https://www.lexaloffle.com/bbs/?tid=50654 https://www.lexaloffle.com/bbs/?tid=50654 Wed, 14 Dec 2022 17:46:30 UTC midi 10:050 High Tom <p>Taking a crack today at building drum kit SFX - I've labeled this one as a &quot;High Tom&quot;, but if you play it on a lower note than C2, I think it'll probably serve for whatever tom you need. You do need to take care of fading out the notes yourself, though - the SFX ends on a held G1, just to let the drums have a longer sustain than 32 ticks.</p> <p> <iframe src="sfxp2.php?id=40166_26" width="402" height="300" style="border:none; overflow:hidden" scrolling="no" allow="autoplay"></iframe><a style="cursor:pointer; font-size:8pt" onclick=' var el = document.getElementById("sfxcode_40166_26"); if (el.style.display == "none") el.style.display = ""; else el.style.display = "none"; microAjax("/bbs/sfxc/40166_26.txt", function (retdata){ var el = document.getElementById("sfxcode_40166_26"); el.innerHTML = retdata; el.focus(); el.select(); } ); '> [sfx] </a> <textarea rows=3 class=lexinput id="sfxcode_40166_26" style="width:480px;background-color:#fed;display:none;overflow:hidden; font-size:4pt;"></textarea> </p> https://www.lexaloffle.com/bbs/?tid=49640 https://www.lexaloffle.com/bbs/?tid=49640 Tue, 04 Oct 2022 22:55:59 UTC