<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Keith&#039;s Electronics Blog</title>
	<atom:link href="http://www.neufeld.newton.ks.us/electronics/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.neufeld.newton.ks.us/electronics</link>
	<description></description>
	<lastBuildDate>Fri, 14 Aug 2026 01:53:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Synthesizer Programming Pulse Demo: Roland M-OC1 (1995)</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=2453</link>
		<comments>http://www.neufeld.newton.ks.us/electronics/?p=2453#comments</comments>
		<pubDate>Fri, 14 Aug 2026 01:53:08 +0000</pubDate>
		<dc:creator>Keith Neufeld</dc:creator>
				<category><![CDATA[Synthesizers]]></category>

		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=2453</guid>
		<description><![CDATA[The dark horse in my pulse sound programming demo is my Roland M-OC1 Sound Expansion / Orchestra module, built to provide a library of orchestral sounds for studio work. Let&#8217;s just jump right to the finished sound sample and then I can tell you about how to get there: Final mix &#8220;Cheaty McCheaterpants!&#8221; I hear [...]]]></description>
			<content:encoded><![CDATA[<p>The dark horse in my <a href="?p=2419">pulse sound programming demo</a> is my Roland M-OC1 Sound Expansion / Orchestra module, built to provide a library of orchestral sounds for studio work.  Let&#8217;s just jump right to the finished sound sample and then I can tell you about how to get there:</p>
<p><a href="http://www.neufeld.newton.ks.us/images/electronics/2026/08/09/1995 M-OC1 -- 01 final.mp3">Final mix</a></p>
<p>&#8220;Cheaty McCheaterpants!&#8221; I hear you cry.  &#8220;You have multiple instruments playing there &#8212; where&#8217;s the challenge in that?!&#8221;</p>
<p>Well, this whole series is about how to achieve as close as possible to a particular imagined pulsing sound using the particular features (or working around the particular limitations) of different synthesizers; and this one has particular features that are particularly well-suited to this particular task.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2026/08/09/IMG_20260809_1702_1524-white-balance.png"><img src="http://www2.neufeld.newton.ks.us/images/electronics/2026/08/09/IMG_20260809_1702_1524-white-balance_mid.png" alt="Roland M-OC1 orchestral sound module" /></a></p>
<p>(rackmount module second from the top)</p>
<p>Features:
<ul>
<li>28-voice polyphony across 8 &#8220;Parts&#8221; (instruments)</li>
<li>Stereo audio output</li>
<li>All voices played from PCM-encoded waveforms of recordings of real instruments</li>
<li>Velocity received and used, in some cases not only for amplitude but for the way instruments sound different when played at different dynamics</li>
</ul>
<p>Let me walk you through the orchestration and development of that sound sample on this platform, which relied heavily on the Yamaha QX5 (1986) MIDI sequencer for execution.</p>
<p><span id="more-2453"></span></p>
<h3>Roland M-OC1 Overview</h3>
<p>The orchestral sound module has a common architecture with several other related sound modules &#8212; eight &#8220;Parts,&#8221; of which the first seven can be assigned any &#8220;Patch&#8221; (instrument variant) in the system and the eighth is dedicated to a drum kit or related percussion section.  The module has &#8220;patch&#8221; and &#8220;performance&#8221; modes, with (if I understand it; I&#8217;m still learning the architecture)</p>
<ul>
<li>a Performance being a container for the Patches assigned to each of the eight Parts plus Effects (hazy on this one)</li>
<li>a Part being one of the eight different instruments/variants, which is assigned a Patch and can be assigned its own MIDI channel</li>
<li>a Patch or maybe Tone being a particular instrument/variant, of which there are 226 on this particular module, each of which is made of up of one to four Waveforms</li>
<li>a Waveform being a PCM sample and the smallest unit of sound</li>
</ul>
<p>So to look at the most granular level, Waveform List entry 68 and 69 are Timpani Roll forte and Timpani Roll piano; but I don&#8217;t find any Patch that provides Timpani Roll.  I suspect the PCM samples are provided to allow you to build your own timpani roll &#8230; but I haven&#8217;t got that far yet.</p>
<p>In any case, with that much of the architecture sorted, my task was to decide what instruments to use, assign one to each Part (up to seven, optionally including a separate eighth for percussion), and decide what to have them play.</p>
<h3>The Musical Plan</h3>
<p>I&#8217;ve had this sound module in mind from the inception of this series as a very different approach from classic synthesizers.  And I knew a few things in particular about how I wanted to score the pulse sample for this module:</p>
<ul>
<li>I wanted to use a mix of low strings, low woodwind (expecting English horn or contrabassoon), and low brass for the long pedal tone.</li>
<li>I wanted to have a different but related set of instruments play just the pulses.</li>
<li>I wanted timpani to introduce the pulses.</li>
<li>I wanted to demonstrate what orchestral composers (which I am not, just a past performer) know &#8212; that the audience perceives the &#8220;activity&#8221; of the fastest-moving notes they can hear, even when some (or many) of the instruments are holding longer notes.  In other words, the pedal tone can continue throughout; the pulses can be separate instruments; and the pedal tone needn&#8217;t change to a faster rhythm.</li>
</ul>
<p>So my process was:</p>
<ol>
<li>Audition the different Patches to find candidates for the pedal tone and for the pulses.</li>
<li>Start programming the candidates into different Parts, making sure their timbres blend the way I have in mind (because I can&#8217;t rely on a conductor to give feedback about blend to human performers who will adapt their playing to what&#8217;s needed for my mix).</li>
<li>Program the different musical lines into a sequencer on different MIDI channels, because I have three musical lines and I don&#8217;t have a keyboard with me that can split into more than two zones.</li>
<li>Set and check and set and check and set the levels of the different Parts in the final mix, making sure they balance the way I have in mind (because again I can&#8217;t rely on a conductor to give feedback about balance to human performers who will adapt their playing to what&#8217;s needed for my mix).</li>
<li>Automate the dynamics on the sequencer.</li>
</ol>
<h3>Selecting Candidate Patches</h3>
<p>I sat down with the module, a keyboard, <a href="https://cdn.roland.com/assets/media/pdf/M-OC1_OM.pdf">the manual</a>, and Google Keep to try out the Patches pertaining to my orchestration.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2026/08/09/IMG_20260809_1851_1525-crop.png"><img src="http://www2.neufeld.newton.ks.us/images/electronics/2026/08/09/IMG_20260809_1851_1525-crop_mid.png" alt="Roland M-OC1 Part and Patch control panel" /></a></p>
<p>To do that, hold the Part button and use the arrows to pick which of the eight Parts you&#8217;re editing, then release and use the arrows to scroll through the available Patches.</p>
<p>For the pedal tone, trying out low woodwinds &#8212; 11 English Hrn1, 12 English Hrn2, 13 English Hrn3, 18 Bassoon 1, 19 Bassoon 2:</p>
<p><a href="http://www.neufeld.newton.ks.us/images/electronics/2026/08/09/1995 M-OC1 -- 02 low woodwinds.mp3">Low woodwinds</a></p>
<p>For the pedal tone &#8212; which will quietly change pitches at the end &#8212; I wanted something without a significant initial attack, so I put 11 English Hrn1 onto my list.</p>
<p>For low brass, I listened through a lot of brass, ultimately choosing 58 Tuba 2 and 79 Big Bones to put onto my list:</p>
<p><a href="http://www.neufeld.newton.ks.us/images/electronics/2026/08/09/1995 M-OC1 -- 03 low brass.mp3">Low brass</a></p>
<p>For low strings, 221 Chorus Vc (violoncello) and 222 Stereo Vc were the only realistic choices:</p>
<p><a href="http://www.neufeld.newton.ks.us/images/electronics/2026/08/09/1995 M-OC1 -- 04 cellos.mp3">Cellos</a></p>
<p>On to the pulses.  I wanted timpani to introduce them, so I tested 140-143 Timpani 1-4:</p>
<p><a href="http://www.neufeld.newton.ks.us/images/electronics/2026/08/09/1995 M-OC1 -- 05 timpani.mp3">Timpani</a></p>
<p>You might be wondering where 143 is in that recording, and so am I.  It seems to be much quieter and I wasn&#8217;t hitting the keys with enough velocity to really make it speak.  I entered the second and third onto my list.</p>
<p>For pulsing pitches, I wanted instruments with a brighter timbre but (because I want the pulses to be more &#8220;wuh&#8221;) not particularly sharp attacks.  First, 82 Full Brass and 83-90 Brass Ens 1-8:</p>
<p><a href="http://www.neufeld.newton.ks.us/images/electronics/2026/08/09/1995 M-OC1 -- 06 pulse brass.mp3">Brass for pulsing</a></p>
<p>The latter several sound very similar, but my recollection from an earlier session is that they may have different attacks when played at a higher velocity than is really comfortable for me on this springy keyboard.  I ended up putting 82 Full Brass, 84 Brass Ens 2, and 90 Brass Ens 8 onto the list.</p>
<p>Next, sampling low strings for pulsing &#8212; 165-171 Strs L-H (low-high) 1-7, 172 Agitato Strs, 173 Vivace Strs, 174-175 Strs M-H 1-2, and 176-178 Strs L-M 1-3:</p>
<p><a href="http://www.neufeld.newton.ks.us/images/electronics/2026/08/09/1995 M-OC1 -- 07 pulse strings.mp3">Low strings for pulsing</a></p>
<p>Of these, 166 Strs L-M 1, 172 Agitato Strings, 173 Vivace Strings, 176 Strings L-M 1, and 177 Strings L-M 2 made the list.</p>
<p>Finally (for auditioning instruments), 203-204 Pizzicato (plucked) 1-2:</p>
<p><a href="http://www.neufeld.newton.ks.us/images/electronics/2026/08/09/1995 M-OC1 -- 08 pizzicato.mp3">Pizzicato strings</a></p>
<h3>MIDI Assignments (and Woes)</h3>
<p>With some options on the table, I started &#8220;mixing&#8221; them (setting levels to blend well).  In the sound module, which is not what I&#8217;d have preferred to do.</p>
<p>The whole time, I&#8217;d envisioned writing the orchestral score in MuseScore, including dynamics for the different instruments, and letting it play back the parts for me to the sound module.  Alas, at least on the Mac, MuseScore has removed playback to external MIDI devices.  Not to worry; I can save the score as a MIDI file and learn enough Ardour to import it and play it back from there.  Alas, MuseScore writes a bunch of Program Change information at the beginning of the MIDI file that resets every carefully-selected patch on the M-OC1.  Not to worry; surely the Internet can tell me how to delete those in Ardour.  Alas, an hour gone by and no such occurrence.</p>
<p>Sooooo &#8230; I&#8217;ll do the playback from the 1986 Yamaha QX5 hardware sequencer.  It has 8 tracks and each track can hold (mix down) multiple MIDI channels&#8217; data which can be broken back out (extracted) if needed &#8230; so record the parts into track 1 and mix down to track 2.</p>
<p>The typical M-OC1 operating mode is one MIDI channel per Part &#8212; channel 1 for Part / instrument 1, channel 2 for Part / instrument 2, etc..  However &#8230;</p>
<p>Dynamic (volume) changes will be stored/edited in the QX5.  But for the pedal tone instrument group, all the instruments will be playing the same notes and all the instruments will have a constant mix &#8212; I won&#8217;t be swelling one up above the others.</p>
<p>So why record the same part and duplicate exactly the same notes and dynamics into multiple channels?  Instead, I glumped all of the pedal tone Parts / instruments onto MIDI channel 1 (I configured the M-OC1 with Parts 1-4 on MIDI channel 1), put timpani (Part 5) for timpani alone on MIDI channel 2, and glumped the pulse Parts / instruments (Parts 6-7) onto MIDI channel 3.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2026/08/09/IMG_20260809_2109_1526-crop.png"><img src="http://www2.neufeld.newton.ks.us/images/electronics/2026/08/09/IMG_20260809_2109_1526-crop_mid.png" alt="Roland M-OC1 parameter section" /></a></p>
<p>To set the MIDI channel, first hold Part and use the arrows to select the desired Part.  Then press Select to enter parameter-edit mode, press it until the LED next to row 2 is lit, and press F1 to select column 1, then use the arrows to set the desired MIDI channel.</p>
<h3>Selecting and Blending Instruments</h3>
<p>Next was to tediously go through the Parts deciding which Patches (instruments) blend well together.  In my case, after sampling for similar attacks (starts of notes) and ambience (echo/reverb, some of which I believe is in the wavetables and some of which can be edited if you know what you&#8217;re doing), I ended up with:</p>
<ul>
<li>Pedal tone
<ul>
<li>11 English horn 1</li>
<li>58 Tuba 2</li>
<li>79 Big Bones</li>
<li>221 Chorus Vc</li>
</ul>
</li>
<li>Timpani
<ul>
<li>141 Timpani 2</li>
</ul>
</li>
<li>Pulses
<ul>
<li>84 Brass Ens 2</li>
<li>177 Strings L-M 2</li>
</ul>
</li>
</ul>
<p>I wanted the tuba in the tooty low end of its range, so I used the parameter edit (Key Shift &#8212; row 2 column 2) to lower it by 12 semitones (an octave).</p>
<p>And then to blend, again parameter edit, this time Level (row 1 column 1) to set the master volume level of each instrument for a nice blend.</p>
<p><a href="http://www.neufeld.newton.ks.us/images/electronics/2026/08/09/1995 M-OC1 -- 09 blend.mp3">Blending instruments</a></p>
<p>As an exaggerated example to make the point, here the cello starts out dominating the mix and then trims down to take its place in a nice blend.</p>
<h3>Recording and Editing</h3>
<p>Because I have three independent musical parts (some of which incidentally comprise multiple M-OC1 Parts) &#8212; pedal tone, timpani, and pulsing notes &#8212; and not enough coordination to play them simultaneously, I recorded them into the Yamaha QX5 MIDI sequencer.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2026/08/13/IMG_20260813_2001_1533-scaled.png"><img src="http://www2.neufeld.newton.ks.us/images/electronics/2026/08/13/IMG_20260813_2001_1533-scaled_mid.png" alt="Yamaha QX5 MIDI sequencer" /></a></p>
<p>I set it for 4/4 time and recorded the pedal tone into track 1, holding the low E for the first 9 1/2 measures, then F and D for a beat each, E for a measure and a half, etc.  After recording, I entered Measure Edit, selected all measures, and quantized to eighth notes because I&#8217;m not used to recording one part at a time; and let&#8217;s face it, I&#8217;m sloppy.</p>
<p>I then had the notes recorded and edited to the desired timing for the first part, but with no dynamics.  In Measure Edit, I selected all measures, subtracted Velocity down to the minimum, added a crescendo over the first four measures (these M-OC1 instruments respond to velocity changes mid-note; not all would), then added Velocity to measures 5-19 to bring it up to the finishing level of the crescendo.</p>
<p>With the first part ready in track 1 (recorded and playing back on MIDI channel 1), I &#8220;mixed down&#8221; track 1 to track 2.</p>
<p>I then played back track 2 (containing the pedal tone on channel 1) while recording the timpani part into track 1 on channel 2.  Again quantize, drop Velocity to minimum, add crescendo to measures 5-8, add Velocity to remaining measures, and mix down to track 2.</p>
<p>Lastly, play back track 2 (containing pedal tone on channel 1 and timpani on channel 2) while recording the pulse instruments into track 1 on channel 3.  Quantize, drop Velocity, crescendo, add Velocity, mix down to track 2.</p>
<p>Then to perform, play back track 2 and record the audio into Audacity.  All of the notes and dynamics are automated; nothing to touch.  It&#8217;s a matter of &#8220;rendering&#8221; from MIDI to audio.</p>
<h3>Applying This Method More Broadly</h3>
<p>&#8220;Wait, wait, wait!&#8221; I hear you cry.  &#8220;This is the same as recording multiple takes!  You could do this with any synthesizer!&#8221;</p>
<p>Well, certainly!  I mean, it&#8217;s not the same as recording in multiple takes.  That requires either a digital audio workstation (DAW) that can play back MIDI (Audacity can&#8217;t and I haven&#8217;t learned Ardour yet) while recording the resulting audio or playing the later takes while listening to the click track or to earlier takes; and it requires either latency correction (playback isn&#8217;t quite instantaneous and A/D recording is surprisingly far from instantaneous) or playing all of the parts to the click track without hearing the earlier ones.  But yes, I could absolutely record multiple takes using the same synthesizer.  I plan to.</p>
<p>&#8220;Or,&#8221; you cry, &#8220;you could play back the MIDI sequencer through multiple regular synthesizers!&#8221;</p>
<p>Yes, again, yes.  Might do that as well.</p>
<p>But the point here is to explore the technique of using multiple instruments to accomplish the drone + pulsing effect and the capability of performing or &#8220;performing&#8221; those multiple instruments in a single take using the M-OC1, which makes it so easy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neufeld.newton.ks.us/electronics/?feed=rss2&#038;p=2453</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Synthesizer Programming Pulse Demo: Behringer Neutron (2018)</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=2446</link>
		<comments>http://www.neufeld.newton.ks.us/electronics/?p=2446#comments</comments>
		<pubDate>Sat, 08 Aug 2026 04:08:00 +0000</pubDate>
		<dc:creator>Keith Neufeld</dc:creator>
				<category><![CDATA[Synthesizers]]></category>

		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=2446</guid>
		<description><![CDATA[The next synthesizer for my pulse sound programming demo is my Behringer Neutron, a semi-modular analog synthesizer original to Behringer. It has signal paths hardwired internally but they can be interrupted, rerouted, and supplemented using the physical patch bay. It has no keyboard, so I&#8217;ve provided MIDI input. Features: Monophonic &#8212; plays only one note [...]]]></description>
			<content:encoded><![CDATA[<p>The next synthesizer for my <a href="?p=2419">pulse sound programming demo</a> is my Behringer Neutron, a semi-modular analog synthesizer original to Behringer.  It has signal paths hardwired internally but they can be interrupted, rerouted, and supplemented using the physical patch bay.  It has no keyboard, so I&#8217;ve provided MIDI input.</p>
<p><a href="http://www.neufeld.newton.ks.us/images/electronics/2026/08/06/IMG_20260806_1855_1514-white-balance.png"><img src="http://www.neufeld.newton.ks.us/images/electronics/2026/08/06/IMG_20260806_1855_1514-white-balance_mid.png" alt="Behringer Neutron synthesizer and Alesis Vortex keytar" /></a></p>
<p>Features:
<ul>
<li>Monophonic &#8212; plays only one note at a time &#8212; or paraphonic (can split the two oscillators to separate notes)</li>
<li>Monaural &#8212; one-channel audio output</li>
<li>2 voltage-controlled oscillators (VCOs) &#8212; sine, triangle, sawtooth, square, or PWM &#8212; pitch is controlled by voltage and I don&#8217;t find it particularly stable</li>
<li>patch bay that can patch almost any signal to the control input of almost any other signal</li>
<li>1 low-frequency oscillator (LFO) &#8212; sine, triangle, sawtooth, square &#8212; that&#8217;s hardwired to modulate VCF (and maybe more things I&#8217;m overlooking) and can be patched to modulate anything</li>
<li>2 ADSR envelope generators that are hardwired to modulate amplitude and VCF and can be patched to modulate anything</li>
<li>Velocity received; can be configured to control VCF and can be patched to modulate anything</li>
<li>Numerous other features that I won&#8217;t use and one that I&#8217;ll describe when I do</li>
</ul>
<p>Let&#8217;s get programming.</p>
<p><span id="more-2446"></span></p>
<h3>Make it Make Sound</h3>
<p>Like the JX-8P, the Neutron has fewer controls than the Odyssey that mysteriously make it not make any sound, but for a good start:</p>
<ul>
<li>VCF Frequency to maximum (otherwise you&#8217;re low-pass filtering with a very low cutoff)</li>
<li>Output Volume to mid (whether you&#8217;re using line out or headphones), because that&#8217;s the master gain</li>
<li>Overdrive Tone to center and Level to mid, because that&#8217;s the other master gain</li>
<li>Not necessary for making sound, but start with OverDrive Drive at minimum (because it&#8217;s a really aggressive preamplifier)</li>
<li>Envelope 1 ADSR to about 9:00 &#8211; 2:00 &#8211; 9:00 &#8211; 2:00</li>
</ul>
<h3>Oscillators</h3>
<p>In the Oscillator section, turn the Oscillator Mix all the way CCW to hear just OSC1.  On the Neutron, the square wave seems a bit too dull, so set OSC1 Shape to sawtooth.</p>
<p>Start by setting its Range to 8 for tuning.</p>
<p>Pressing a key should now play a note.  If you&#8217;re using headphones, plug them in and carefully dial up the headphone volume.  If you&#8217;re using a mixer, press a key and dial up the input trim until you&#8217;re peaking a little below 0 dB, or dial up until input clipping lights and back down until it doesn&#8217;t.</p>
<p>Now tune the synthesizer.  Like the Odyssey, it doesn&#8217;t have set pitch.  And worse than the Odyssey, I don&#8217;t find that it holds pitch well at all &#8212; I seem to need to retune every 30-60 minutes &#8212; but it also doesn&#8217;t help that the Tune potentiometers have no resistance whatsoever and are the largest and easiest-to-bump knobs on the whole console.</p>
<p>Play a reference pitch, press that key, and turn OSC1 Tune to tune to that pitch.</p>
<p>Finally (for OSC1 initial configuration), set the Range to 32 for the beginning of a rich dual-oscillator sound.  Here&#8217;s the resulting audio of the base configuration of OSC1:</p>
<p><a href="http://www.neufeld.newton.ks.us/images/electronics/2026/08/07/2018 Neutron -- 01 OSC1.mp3">OSC1 sample</a></p>
<p>To add the second oscillator, set Oscillator Mix to about the middle, OSC2 Shape to sawtooth also, OSC2 Range to 16; and then OSC2 Tune to tune it first to match the pitch of OSC1 (an octave higher) and then to slightly detune it down.</p>
<p><a href="http://www.neufeld.newton.ks.us/images/electronics/2026/08/07/2018 Neutron -- 02 OSC2.mp3">OSC2 tuning and detuning</a></p>
<p>The shimmer from the detuning is enough movement for my taste, so I won&#8217;t use LFO to modulate pitch.</p>
<h3>Filtering</h3>
<p>The Neutron&#8217;s sawtooth doesn&#8217;t seem as brassy as some of the other synthesizers, but I still want to dull it a bit.  Dial back the VCF Frequency until satisfied, then bring up VCF Envelope until a little bit of punchy attack is restored.  VCF Envelope uses Envelope 2, which I&#8217;ve set to minimum, 9:00, minimum, minimum.</p>
<p><a href="http://www.neufeld.newton.ks.us/images/electronics/2026/08/07/2018 Neutron -- 03 VCF.mp3">Bringing down VCF to filter harmonics and bringing up VCF Envelope to restore some harmonics on attack</a></p>
<p>In my case, both the VCF Frequency and the VCF Envelope ended up around the 1:00 positions.</p>
<h3>Envelope</h3>
<p>Adjust the attack and decay to make softer &#8220;wuh&#8221; pulses, in my case with attack to about 1:20 and decay still at 2:00:</p>
<p><a href="http://www.neufeld.newton.ks.us/images/electronics/2026/08/07/2018 Neutron -- 04 envelope.mp3">Softening the attack as much as possible for eighth-note pulsing</a></p>
<h3>Crescendo the Pulses Only</h3>
<p>The reason for this entire series is that I want to fade in a long note and then have pulses barely audible above that note with the pulses increasing in volume until they dominate and break to eighth notes.</p>
<p>Like the Odyssey, the Neutron has a VCA Bias control that brings up the minimum amplitude, with the attack-decay envelope added on top:</p>
<p><a href="http://www.neufeld.newton.ks.us/images/electronics/2026/08/07/2018 Neutron -- 05 VCA Bias.mp3">VCA Bias sets minimum amplitude</a></p>
<p>But with no other changes, the pulses are a fixed amplitude above that, not controlled for fading in.  And here&#8217;s where the modular synth really shines.</p>
<p>Internally, Envelope 1 is generating control voltages to feed to the Voltage-Controlled Amplifier to set the amplitude at different moments in the lifespan of a single note.  (And VCA Bias sets a base voltage that keeps the note playing forever.)</p>
<p>The modular synth allows us to break the chain between Envelope 1 and the VCA <em>and route the envelope&#8217;s output control voltage to a variable attenuator</em> before sending the sum of VCA Bias and (attenuated) Envelope 1 to the VCA.  That finally lets us directly set the amount that the pulses peak above the drone.</p>
<p>To prepare the attenuated envelope:</p>
<ol>
<li>Turn Envelope 1 Sustain to minimum, because we only need to provide the pulses and not any ongoing amplitude.</li>
<li>On the right, patch Envelope 1 Out to Attenuator 1 In, to prepare to control the amplitude of the pulses themselves.</li>
<li>Patch Attenuator 1 Out (not 2 as shown in the photo :-/ ) to VCA Control Voltage In, to add the variable-amplitude pulses back onto the Bias drone level to generate the final amplitude.</li>
<li>Set Attenuator 1 to minimum.</li>
<li>Bring up Envelope 1 Release to 12:00 to finish a soft decay if I release keys before the attack-decay cycle finishes.</li>
</ol>
<p><a href="http://www.neufeld.newton.ks.us/images/electronics/2026/08/07/IMG_20260807_2234_1519-white-balance.png"><img src="http://www.neufeld.newton.ks.us/images/electronics/2026/08/07/IMG_20260807_2234_1519-white-balance_mid.png" alt="Behringer Neutron patch bay" /></a></p>
<p>And then to perform:</p>
<ol>
<li>Make sure the last note I played was the low E.</li>
<li>Start recording.</li>
<li>Fade up the VCA Bias to a <em>mp</em> level, about 1:00.</li>
<li>Start playing quarter-note pulses on the E, completely inaudible.</li>
<li>Fade up Attenuator 1.  The attack-decay peaks start being audible above the drone level of the VCA Bias.  Continue fading up until they&#8217;re distinctly audible.</li>
<li>Switch to the eighth-note pattern, clearly audible above the drone.</li>
<li>Stop on an E.</li>
<li>Fade the VCA Bias back out.</li>
</ol>
<p><a href="http://www.neufeld.newton.ks.us/images/electronics/2026/08/07/2018 Neutron -- 06 final.mp3">Final recording with envelope attenuated and added to VCA Bias</a></p>
<p>As with the Odyssey, this was all performed with two hands, one on the MIDI keyboard and one moving VCA Bias and then Attenuator 1.</p>
<p>It&#8217;s very satisfying to be able to set the drone level with VCA Bias and then control the pulse amplitude (which is added to the drone level) with Attenuator 1 rather than (on the Odyssey) using VCA Gain to set a minimum amplitude and bringing up the regular gain until the pulses peek / peak above the drone.  I really appreciate the direct control over the variable I want to control rather than the indirect control that happens to accomplish the same result.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neufeld.newton.ks.us/electronics/?feed=rss2&#038;p=2446</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Synthesizer Programming Pulse Demo: Roland JX-8P (1985)</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=2439</link>
		<comments>http://www.neufeld.newton.ks.us/electronics/?p=2439#comments</comments>
		<pubDate>Fri, 31 Jul 2026 02:47:30 +0000</pubDate>
		<dc:creator>Keith Neufeld</dc:creator>
				<category><![CDATA[Synthesizers]]></category>

		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=2439</guid>
		<description><![CDATA[The chronologically next two synthesizers for my pulse sound programming demo were to be my Unique DBE (Crumar BIT 01 North American rebrand) and Roland Juno-106, but alas, both of them have problems (the Juno had been working for the last two weeks but Sunday I left it on for a couple of hours and [...]]]></description>
			<content:encoded><![CDATA[<p>The chronologically next two synthesizers for my <a href="?p=2419">pulse sound programming demo</a> were to be my Unique DBE (Crumar BIT 01 North American rebrand) and Roland Juno-106, but alas, both of them have problems (the Juno had been working for the last two weeks but Sunday I left it on for a couple of hours and now it doesn&#8217;t work) that I&#8217;m going to have to delay a bit before fixing.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2026/07/30/IMG_20260730_1908_1488-white-balance.png"><img src="http://www2.neufeld.newton.ks.us/images/electronics/2026/07/30/IMG_20260730_1908_1488-white-balance_mid.png" alt="Roland JX-8P synthesizer" /></a></p>
<p>So on to the Roland JX-8P, my first and most sentimental synthesizer.  Ken Janzen (the younger Ken Janzen) was a music whiz who&#8217;d occasionally bring his JX-8P (and sometimes sequencer) to church for special music during my formative years.  Then in college I got access to another JX-8P thanks to the forward-thinking Don Kehrberg, which I ended up buying from the college a few years later.  This one is my third &#8212; that is, I have three now &#8212; just picked up for a good price on Marketplace and noting some glitchy contacts that will require attention sooner or later.  I love this synthesizer obviously for the nostalgia but also for the fat sounds it makes with detuned oscillators, a little bark from the VCF, and what I find to be a particularly lush chorus.</p>
<p>Features:
<ul>
<li>6-voice polyphony</li>
<li>Stereo audio output</li>
<li>2 digitally-controlled oscillators (DCOs) &#8212; sawtooth, PWM, square, or triangle &#8212; pitch is controlled digitally and is as solid as you want it to be</li>
<li>1 low-frequency oscillator (LFO) &#8212; sine, square, or random &#8212; that can modulate pitch, PWM, and VCF (not amplitude)</li>
<li>2 ADSR envelope generators that can modulate pitch, PWM, VCF, and amplitude</li>
<li>Velocity-sensing keys and performance</li>
<li>Onboard chorus</li>
</ul>
<p>Let&#8217;s get programming.</p>
<p><span id="more-2439"></span></p>
<h3>Make it Make Sound</h3>
<p>The JX-8P has fewer controls that make it mysteriously silent than does the Odyssey, but for good measure:</p>
<ul>
<li>VCF Frequency to maximum (otherwise you&#8217;re low-pass filtering with a very low cutoff)</li>
<li>HPF Cutoff Frequency to 0 (otherwise you&#8217;re high-pass filtering with a very high cutoff)</li>
<li>Voltage Controlled Amplifier to mid (because that&#8217;s the master gain)</li>
<li>Volume to mid</li>
</ul>
<p>Note that I have the PG-800 physical control panel for programming sounds.  Without it, I&#8217;d use the membrane keypad to select parameters and the edit slider to change their values &#8230; and then I&#8217;d have to use an outboard MIDI controller for the performance, as you&#8217;ll see in a bit.</p>
<h3>Oscillators</h3>
<p>The first stages of setup are very similar on most synthesizers, so this should initially look familiar.</p>
<p>Set DCO1 to a square wave and (due to the range of the keyboard) to the 16&#8242; voicing.  In the mixer section, set DCO1 mix to max.  Set envelope 2 ADSR to about 3-3-5-3.  You get something about like this:</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2026/07/30/1985 JX-8P -- 01 VCO1.mp3">VCO1 sample</a></p>
<p>To add the second oscillator, set DCO2 to a square wave and &#8212; for a more interesting sound on this synthesizer &#8212; to the 8&#8242; voicing.  In the mixer, set DCO2 mix to max.  I don&#8217;t actually like this synthesizer&#8217;s sound detuning an octave apart, so leave the tuning aligned.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2026/07/30/1985 JX-8P -- 02 VCO2.mp3">VCO2 sample</a> &#8212; Sounds less dull with both oscillators.</p>
<p>Because I&#8217;m not using detuning here for &#8220;movement,&#8221; I&#8217;d like to add the LFO for slow amplitude modulation &#8230; but the JX-8P doesn&#8217;t route the LFO to VCA!  And I don&#8217;t love the sound of pitch-modulated octaves on this synth, so we&#8217;ll leave out LFO vibrato and move on.</p>
<h3>Filtering</h3>
<p>The sound right now is pretty brassy or twangy and I want a dull sound.  That&#8217;s changed by lowering the cutoff frequency of the low-pass VCF, which we set at maximum to get started.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2026/07/30/1985 JX-8P -- 03 VCF take 1.mp3">VCF sample 1</a> &#8212; Bringing the cutoff frequency down to about 7 is fairly dull.</p>
<p>I need a little more life in the sound and &#8212; unlike my thoughts on the Odyssey &#8212; for this sound on the JX-8P, I like a little bit of envelope in the VCF.  Set Envelope 1 ADSR to 0-3-0-0 and VCF Envelope to about 7 or 8.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2026/07/30/1985 JX-8P -- 04 VCF take 2.mp3">VCF sample 2</a> &#8212; Adding a touch of brass to the pulse.</p>
<p>And finally, since we don&#8217;t have a sense of movement from detuning the oscillators, I&#8217;ll add a bit here with LFO on the VCF.  LFO Waveform to Sine, LFO Rate to about 4, VCF LFO to 2 &#8230; and then because I don&#8217;t want that flanging effect happening on shorter notes, add LFO Delay of about 5 to make it wait to bring the LFO into the VCF until a note has been held for a little while.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2026/07/30/1985 JX-8P -- 05 VCF take 3.mp3">VCF sample 3</a> &#8212; Adding movement with VCF LFO.</p>
<h3>Envelope</h3>
<p>Like the Odyssey, the JX-8P starts the ADSR&#8217;s Release step immediately even if you release the key before the attack-decay cycle has finished, so we need to be careful that the attack-decay cycle finishes in slightly less than an eighth note.</p>
<p>I&#8217;ll bring up the Release for a longer decay to hold through the gap between keypresses on repeated pulses and &#8212; because I&#8217;m playing scale notes that are discordant with each other &#8212; that gives me a muddy mess!</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2026/07/30/1985 JX-8P -- 06 muddy release.mp3">Release sample</a> &#8212; Notes overlap unpleasantly.</p>
<p>To fix that, I&#8217;m going to change the JX-8P&#8217;s Key Mode from polyphonic to &#8220;Solo&#8221; (monophonic).</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2026/07/30/1985 JX-8P -- 07 key mode solo.mp3">Solo key mode sample</a> &#8212; Distinct notes again.</p>
<p>With that taken care of, I can now set the attack-decay rates.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2026/07/30/1985 JX-8P -- 08 attack-decay.mp3">Attack-decay sample</a> &#8212; Started at 5; down to 3; back up to about 3.5 for softer pulses at my planned tempo.</p>
<h3>Chorus</h3>
<p>Still very blah; but the JX-8P has a nice chorus effect built in.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2026/07/30/1985 JX-8P -- 09 chorus.mp3">Chorus sample</a> &#8212; No chorus; chorus 1; chorus 2.</p>
<p>Now it&#8217;s getting interesting!</p>
<h3>Crescendo the Pulses Only</h3>
<p>Holding a pedal tone and adding pulses of increasing amplitude on top of it has the same problem as the Odyssey &#8212; the attack always goes to maximum amplitude, so we can&#8217;t (directly) change the amplitude of the attack.</p>
<p>What we <em>can</em> do is lower the Sustain level, which increases the delta of the attack amplitude above sustain amplitude.  We can then push up the VCA Level to compensate for the lower sustain level.  I&#8217;m not smoov enough to crossfade the sustain and VCA level with one hand, so it&#8217;s time to let Mr. Yamaha QX8 MIDI sequencer play the score for me and I&#8217;ll just do the volume automation.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2026/07/30/1985 JX-8P -- 10 final.mp3">Final performance</a> &#8212; Crossfading from Sustain to VCA Level.</p>
<p>There&#8217;s the whole deal:</p>
<ol>
<li>Set VCA to minimum.</li>
<li>Set Envelope 2 Sustain to maximum so the attacks are barely perceptible above it (the opposite setting of the Odyssey&#8217;s method).</li>
<li>Start recording.</li>
<li>Start sequencer playback (&#8217;cause I can&#8217;t do it alone).</li>
<li>Fade up the VCA Gain to a <em>mp</em> level.</li>
<li>Sequencer starts playing quarter-note pulses on the E, barely audible (and audible mostly because of Envelope 1 on the VCF tone rather than Envelope 2 on the VCA volume).</li>
<li>Fade down the Sustain to increase the amplitude of Attack above Sustain and fade up VCA Level to (try to) keep sustain level constant.  Continue crossfading Sustain to VCA Level until the pulses are as distinct as desired.</li>
<li>Stop on an E.</li>
<li>The Release fades the E back out.</li>
</ol>
<p>All of the effects were performed in the synth (no post-processing) with only two hands &#8212; one moving VCA Level and one moving Sustain &#8212; plus the sequencer taking the place of a third hand.</p>
<p>Note that although I did the crossfade using the outboard programmer, I <em>think</em> you could accomplish the same thing without it by using the master volume control in place of VCA Level and by preselecting Envelope 2 Sustain in the editor, then using the Edit fader to crossfade against volume.</p>
<p>And adding more gear, you could use an outboard MIDI expression control run into a Midihub, translating the CC messages into SysEx to reprogram the parameters in realtime, which offers the advantage of crossfading using a single hand but the disadvantage of requiring yet more extra gear.  You&#8217;d also have to figure out the crossfading curves to balance the nonlinear response of a portion of VCA Level against the different nonlinear response of a different portion of Sustain.</p>
<p>None of that is to say it couldn&#8217;t be done &#8212; the point of this series is to show the relative ease and different methods on different synthesizers, with some having easy ways to do it, some having tricksy ways to do it, and some only being able to get close.  For something that otherwise couldn&#8217;t be accomplished, I&#8217;ll cheerfully take tricksy.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neufeld.newton.ks.us/electronics/?feed=rss2&#038;p=2439</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Synthesizer Programming Pulse Demo: Behringer Odyssey (1972 / 2019)</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=2427</link>
		<comments>http://www.neufeld.newton.ks.us/electronics/?p=2427#comments</comments>
		<pubDate>Mon, 27 Jul 2026 01:54:11 +0000</pubDate>
		<dc:creator>Keith Neufeld</dc:creator>
				<category><![CDATA[Synthesizers]]></category>

		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=2427</guid>
		<description><![CDATA[The first synthesizer for my pulse sound programming demo is my Behringer Odyssey, an analog-circuit-faithful replica of the legendary ARP Odyssey, which was first manufactured in 1972. Features: Monophonic &#8212; plays only one note at a time &#8212; or paraphonic (can split the two oscillators to separate notes) Monaural &#8212; one-channel audio output 2 voltage-controlled [...]]]></description>
			<content:encoded><![CDATA[<p>The first synthesizer for my <a href="?p=2419">pulse sound programming demo</a> is my Behringer Odyssey, an analog-circuit-faithful replica of the legendary ARP Odyssey, which was first manufactured in 1972.</p>
<p>Features:
<ul>
<li>Monophonic &#8212; plays only one note at a time &#8212; or paraphonic (can split the two oscillators to separate notes)</li>
<li>Monaural &#8212; one-channel audio output</li>
<li>2 voltage-controlled oscillators (VCOs) &#8212; PWM or sawtooth &#8212; pitch is controlled by voltage and is &#8230; <em>variable</em></li>
<li>1 low-frequency oscillator (LFO) &#8212; square or sine &#8212; that can modulate pitch, PWM, VCF, and amplitude</li>
<li>2 envelope generators &#8212; AR and ADSR &#8212; that can modulate pitch, PWM, VCF, and amplitude</li>
<li>On the Behringer replica, velocity-sensing keys but no incorporation of the velocity in the Odyssey&#8217;s audio; for MIDI transmission only</li>
<li>Numerous other features that I won&#8217;t use and one that I&#8217;ll describe when I do</li>
</ul>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2026/07/26/IMG_20260726_1733_1465-scaled.png"><img src="http://www2.neufeld.newton.ks.us/images/electronics/2026/07/26/IMG_20260726_1733_1465-scaled_mid.png" alt="Behringer Odyssey Synthesizer" /></a></p>
<p>Let&#8217;s get programming.</p>
<p><span id="more-2427"></span></p>
<h3>Make it Make Sound</h3>
<p>There are some controls that will make the Odyssey mystifyingly not make any sound.  First off, set those to <em>make</em> sound:</p>
<ul>
<li>VCF Frequency to maximum (otherwise you&#8217;re low-pass filtering with a very low cutoff)</li>
<li>HPF Cutoff Frequency to minimum (otherwise you&#8217;re high-pass filtering with a very high cutoff)</li>
<li>Voltage Controlled Amplifier fairly high (because that&#8217;s the master gain)</li>
<li>Not necessary for making sound, but start with [Over]Drive switched off</li>
<li>The switches at the bottom of the ADSR section to Keyboard Gate (up), Keyboard Repeat (up), and AR Keyboard Gate (up).</li>
</ul>
<h3>Oscillators</h3>
<p>In the Audio Mixer section, set the VCO1 level to maximum and (for now) VCOC2 level to minimum.  I want a fairly dull sound, so below the VCO1 fader, set the waveform to square.</p>
<p>I&#8217;m making a low sound, so on the left, set the Transpose switch to 2 octaves down.</p>
<p>Set the VCA envelope switch to ADSR.  Set the attack and decay faders halfway between the lowest two marks, sustain to the midpoint, and release a little above the midpoint.</p>
<p>Pressing a key should now play a note.  If you&#8217;re using headphones, plug them in and carefully dial up the headphone volume.  If you&#8217;re using a mixer, press a key and dial up the input trim until you&#8217;re peaking a little below 0 dB, or dial up until input clipping lights and back down until it doesn&#8217;t.</p>
<p>Now tune the synthesizer!  The Odyssey doesn&#8217;t do &#8220;A makes 440 Hz&#8221; &#8212; it does &#8220;A makes some voltage that makes some pitch.&#8221;  It&#8217;s up to you to tune it so that the keys match the tuning system your other instruments are in.</p>
<p>Pick something that generates a reference pitch (I use an online pitch generator and 440 Hz) and hold the key that generates what should be that pitch.  Center the VCO1 coarse and fine frequency faders, then adjust the coarse until the Odyssey matches the reference pitch as closely as possible and fine-tune with the fine fader if necessary.</p>
<p>Finally (for VCO1 initial configuration), set all of the VCO1 lower faders to minimum.  Here&#8217;s the resulting audio of the base configuration of VCO1:</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2026/07/26/1972 Odyssey -- 01 VCO1.mp3">VCO1 sample</a></p>
<p>I don&#8217;t have an audio player set up in WordPress, so you&#8217;ll need to click that link and may want to open it in a new tab.</p>
<p>Not very inspiring yet!  Let&#8217;s add the other oscillator.  In the Audio Mixer, set the VCO2 level all the way up and also set VCO2 to the square wave.  In the VCO2 Frequency section, use the coarse and fine knobs to tune VCO2 to the same pitch as VCO1 &#8230; and then slightly <em>detune</em> them.  The overall output amplitude has increased, so back down the VCA fader or your input trim until you&#8217;re not clipping again.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2026/07/26/1972 Odyssey -- 02 VCO2.mp3">VCO2 sample</a> &#8212; Much more interesting already with two oscillators detuned, even apart from my playing faster. <img src='http://www.neufeld.newton.ks.us/electronics/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>It would be common at this point to add LFO to the oscillator frequency (pitch) for vibrato; but the rich sound of the detuned oscillators is already enough sense of &#8220;movement&#8221; for the effect I&#8217;m building, so I&#8217;ll stop there.</p>
<h3>Filtering</h3>
<p>The sound right now is pretty brassy or twangy and I want a dull sound.  That&#8217;s changed by lowering the cutoff frequency of the low-pass VCF, which we set at maximum to get started.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2026/07/26/1972 Odyssey -- 03 VCF take 1.mp3">VCF sample 1</a> &#8212; Bringing the cutoff frequency down to the 75% mark is quite dull or distant.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2026/07/26/1972 Odyssey -- 04 VCF take 2.mp3">VCF sample 2</a> &#8212; Opening the cutoff frequency back up a little above the 3rd mark to about 80% of the fader range puts a little more life back into it without being as brassy as it was originally.</p>
<p>It would be common at this point to add envelope to the VCF to make each note sound brighter on the initial pulse &#8212; and even resonance to make each note chirp when played &#8212; but I&#8217;m going for a dull sound and I don&#8217;t want a brighter initial attack.</p>
<h3>Envelope</h3>
<p>&#8220;Envelope&#8221; is the term for how the amplitude (loudness) of the sound varies over the course of one note and it&#8217;s built here using</p>
<ol>
<li>Attack &#8212; how quickly the sound hits its maximum volume</li>
<li>Decay &#8212; how quickly the sound fades back from its maximum volume while the note is still being held</li>
<li>Sustain &#8212; how far the sound fades back while the note is still being held</li>
<li>Release &#8212; how quickly the sound dies off once the note is released</li>
</ol>
<p>Not only do these change the qualitative experience of the sound &#8212; a very sharp percussive sound like a plucked string or piano hammer versus a softer start like legato strings &#8212; but they can even impact the ability to perform a musical section at all, if the attack and decay are slower than the pulse of the music.  Which in my case, I think they are, for the eighth notes at the end.  That is to say, I think the attach-decay cycle takes longer than my eighth notes.</p>
<p>Adjusting the attack and decay to the right speed is &#8230; interesting &#8230; because this synth (and at least one other) <em>moves to the release from the current amplitude if the attack and decay haven&#8217;t finished yet</em>.</p>
<p>The attack always goes to full amplitude and then the note would normally decay to the lower sustain level.  When releasing a key, you then expect to hear it die off from that lower sustain level.  But on this synth, if you release a key before the attack-decay cycle finishes, the note dies off from <em>however loud it happened to be in the attack-decay cycle</em>.</p>
<p>This has the counterintuitive effect that holding each key ensures that it&#8217;s quiet and releasing it quickly makes it loud!  This in turn requires an organist&#8217;s degree of keyboard discipline (that I don&#8217;t quite have) rather than merely a pianist&#8217;s (that I barely have after so long away).</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2026/07/26/1972 Odyssey -- 05 early release.mp3">Early key release sample</a> &#8212; The first time through, holding each key long enough to get through the attack-decay; the second time through, playing each note staccato and therefore starting each release from a higher starting amplitude than the sustain level, which makes the release quite loud.</p>
<p>It&#8217;s not common in my experience to have a synthesizer&#8217;s attack and decay set slow for a fast pulse, so this is rarely an issue.  But because I want the pulses to be slow &#8220;wuh&#8221; sounds even on the eighth notes, I have to use a slower-than-typical attack and decay and therefore I have to be careful with my keyboard articulation.</p>
<p>With that discovery out of the way, now adjust the attack and decay to where I need them for my sound:</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2026/07/26/1972 Odyssey -- 06 attack-decay tuning.mp3">Adjusting attack and decay sample</a> &#8212; Tempo dictated by the full attack-decay cycle, shortening until I can play eighth-note pulses.</p>
<h3>Crescendo the Pulses Only</h3>
<p>The reason for this entire series is that I want to fade in a long note and then have pulses barely audible above that note with the pulses increasing in volume until they dominate and break to eighth notes.  But I&#8217;ve already said that the attack always goes to full amplitude; and the attack-decay is what makes the pulses; so how can we make the amplitude of the pulses slowly increase?</p>
<p>Here&#8217;s where the Odyssey&#8217;s (exceedingly rare for a fixed-architecture [non-modular] synthesizer) VCA Gain comes to the rescue.  In spite of its name that suggests it might be a gain multiplier, it&#8217;s a VCA bias or minimum.  It sets a minimum level for the VCA, whereas the VCA (master) control is a multiplier for what the envelope is doing that is (as far as I can tell) superimposed over (not added to) the VCA Gain.</p>
<p>The VCA Gain, by the way, makes the Odyssey hold the last-played note forever.  So &#8230;</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2026/07/26/1972 Odyssey -- 07 VCA Gain.mp3">VCA Gain sample</a></p>
<p>There&#8217;s the whole deal:</p>
<ol>
<li>Make sure the last note I played was the low E.</li>
<li>Set VCA and VCA Gain to minimum.</li>
<li>Set Sustain to a minimum so the sustain level doesn&#8217;t add to the VCA Gain drone level.</li>
<li>Start recording.</li>
<li>Fade up the VCA Gain to a <em>mp</em> level.</li>
<li>Start playing quarter-note pulses on the E, completely inaudible.</li>
<li>Fade up the VCA.  The attack-decay peaks start being audible above the drone level of the VCA Gain.  Continue fading up until they&#8217;re distinctly audible.</li>
<li>Switch to the eighth-note pattern, clearly audible above the drone.</li>
<li>Stop on an E.</li>
<li>Fade the VCA Gain back out.</li>
</ol>
<p>All performed in the synth (no post-processing) with only two hands &#8212; one on the keyboard, one moving VCA Gain and then VCA.</p>
<p>I think for a refinement, I might try to pre-position the VCA at the point that the pulses are barely audible so that those of us who feel 4/4 in our heads are aligned correctly with the measures all along instead of not being sure where the count is when the pulses start.  (This could also be handled by making the first pulse of each measure louder; but without velocity-responsive sound generation, that would require considerably more finesse on the VCA fader.)  Also the VCA does increase the amplitude of the drone during part of the range of its movement &#8212; a weird interaction that creates an imperfect result, since I said I wanted the level under the pulses to stay the same throughout.</p>
<p>You&#8217;ll be thinking of other ways to get close to or accomplish the same effect &#8230; and I&#8217;ll get to those methods when I get to other synthesizers.  My goal is not to demonstrate every method that each synthesizer could use, but the <em>best</em> or easiest method that makes a given synthesizer shine (or unshine) at a given task.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neufeld.newton.ks.us/electronics/?feed=rss2&#038;p=2427</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Synthesizer Programming:  Pulse Demo Overview</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=2419</link>
		<comments>http://www.neufeld.newton.ks.us/electronics/?p=2419#comments</comments>
		<pubDate>Sun, 26 Jul 2026 22:16:21 +0000</pubDate>
		<dc:creator>Keith Neufeld</dc:creator>
				<category><![CDATA[Synthesizers]]></category>

		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=2419</guid>
		<description><![CDATA[Keith, why do you need so many synthesizers? Well, they do different things. I do have some synthesizers that only have built-in sounds; but the ones that speak to me the most are the ones where you build the sounds yourself. I&#8217;ve been thinking about a particular sound and how it would be made differently [...]]]></description>
			<content:encoded><![CDATA[<p>Keith, why do you need so many synthesizers?</p>
<p>Well, they do different things.</p>
<p>I do have some synthesizers that only have built-in sounds; but the ones that speak to me the most are the ones where you build the sounds yourself.  I&#8217;ve been thinking about a particular sound and how it would be made differently (and to different degrees of success) on different synthesizers and thought I&#8217;d demo that process on a representative sample of each underlying architecture.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2026/07/26/20260727-pulsazioni-poco-a-poco.png"><img src="http://www2.neufeld.newton.ks.us/images/electronics/2026/07/26/20260727-pulsazioni-poco-a-poco_mid.png" alt="musical notation showing a held note being pulsed louder and louder" /></a></p>
<p>Traditional musical notation doesn&#8217;t have a clear way to capture exactly what I have in mind, so let me walk you through it:  A low E is gradually faded in; then imperceptibly at first it starts getting pulses on the quarter notes, with the underlying sound held constant between the pulses as only the pulses grow louder; then the pulses speed up to eighth notes and the pitch starts changing in a repeating pattern.  The measure and repeat counts are arbitrary and selected here mainly to have room to write the notations.</p>
<p>Further and not notated, I want the held note to be a fairly dull sound and I want the pulses to be &#8220;w-w-w&#8221; and eventually &#8220;wuh-wuh-wuh&#8221; sounds &#8212; not sharp; also dull.</p>
<p>What&#8217;s going to be difficult about programming synthesizers to do this is increasing the dynamic (amplitude) of only the pulses while holding the drone at a constant amplitude.  Only one that I have lined up can actually do it natively and I believe only other other can do it with coaxing.</p>
<h3>MuseScore</h3>
<p>As a side note for the curious, that score clip is engraved using MuseScore, the zero-cost open-source music notation software.  I have a fair amount of sheet music I notated years ago in commercial music notation software that went out of business and now I can&#8217;t open it and I didn&#8217;t have the foresight to export to PDF; so where I&#8217;m lucky, I still have a hardcopy I can find and where I&#8217;m unlucky, it&#8217;s locked away and I don&#8217;t expect to be able to get it back.</p>
<p>From time to time I&#8217;d look for an open-source replacement and kept finding MuseScore but never did anything with that information until earlier this year, when I needed to do more music notation, installed it, and love it.  It&#8217;s <em>fairly</em> easy to use; it does gorgeous typesetting; and it gives you control over every tiny little detail of the typesetting.</p>
<p>If you&#8217;re looking to try it, I highly recommend keeping it open in one window and Gemini open in another.  When you want to do something, just ask Gemini how.  It&#8217;s infinitely patient and often correct.  Very good for instructions on basic operations; nearly useless for deep menu diving for fine-tuning typesetting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neufeld.newton.ks.us/electronics/?feed=rss2&#038;p=2419</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ESP-WROOM-32 with ST7789 LCD (Wiring, Adafruit_GFX and Adafruit_ST77* Libraries, and Arduino Code)</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=2400</link>
		<comments>http://www.neufeld.newton.ks.us/electronics/?p=2400#comments</comments>
		<pubDate>Fri, 18 Apr 2025 00:10:55 +0000</pubDate>
		<dc:creator>Keith Neufeld</dc:creator>
				<category><![CDATA[Arduino]]></category>

		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=2400</guid>
		<description><![CDATA[I&#8217;m wanting to play with a medium-resolution LCD screen attached to something that I can program from the Arduino IDE and I happen to have some &#8220;AITRIP&#8221;-branded ESP-WROOM-32 modules on hand. Connecting an ST7789-driven LCD to one of them involved filling in a number of gaps in the documentation I was able to find, so [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m wanting to play with a medium-resolution LCD screen attached to something that I can program from the Arduino IDE and I happen to have some &#8220;AITRIP&#8221;-branded ESP-WROOM-32 modules on hand.  Connecting an ST7789-driven LCD to one of them involved filling in a number of gaps in the documentation I was able to find, so let me write it all down in one place in case it&#8217;s useful to someone else, including Future Keith.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2025/04/17/IMG_20250417_184837_0648.jpg"><img src="http://www2.neufeld.newton.ks.us/images/electronics/2025/04/17/IMG_20250417_184837_0648_mid.jpg" alt="ESP-WROOM-32 driving Waveshare 2.0-inch LCD" /></a></p>
<p>The LCD I bought is a <a href="https://www.waveshare.com/wiki/2inch_LCD_Module">Waveshare 2.0&#8243; LCD</a> using an ST7789V driver chip, a variant of a popular (<em>the</em> popular?) LCD driver.</p>
<p><span id="more-2400"></span></p>
<h3>Wiring</h3>
<p>The first puzzle was how to wire the LCD to the ESP32.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2025/04/17/AITRIP_ESP-WROOM-32_pinouts.jpg"><img src="http://www2.neufeld.newton.ks.us/images/electronics/2025/04/17/AITRIP_ESP-WROOM-32_pinouts.jpg" alt="AITRIP ESP-WROOM-32 module pinouts" /></a></p>
<p>Different ESP32 module manufacturers provide different module pin counts and I suspect (though haven&#8217;t verified) different pinouts for the same pin counts; so I&#8217;m specifically referencing the pinouts for the module I&#8217;m using.</p>
<p>I found a couple of forum posts &#8212; unfortunately didn&#8217;t save the links &#8212; indicating that the LCD can run on 5V or 3.3V power and that it gets grumpy if the data lines are at a different voltage than its power.  This is easily handled &#8212; power the LCD from the ESP32&#8242;s 3.3V regulator.  So first wire the power connections:</p>
<table border=1 cellspacing=0 cellpadding=5>
<tr>
<th>LCD Pin</th>
<th>ESP32 Pin</th>
<th>Signal</th>
</tr>
<tr>
<td>VCC</td>
<td>VDD 3V3</td>
<td>3.3V regulated power</td>
</tr>
<tr>
<td>GND</td>
<td>GND</td>
<td>ground</td>
</tr>
</table>
<p>Next, the LCD uses SPI, so wire the data and clock lines.  The ESP32 has labeled pins for these so I used them; though I saw a forum post that the ESP32&#8242;s hardware SPI can be matrixed to any digital I/O pin, so it&#8217;s possible that these could be reassigned elsewhere.</p>
<table border=1 cellspacing=0 cellpadding=5>
<tr>
<th>LCD Pin</th>
<th>ESP32 Pin</th>
<th>Signal</th>
</tr>
<tr>
<td>DIN</td>
<td>VSPI MOSI aka GPIO 23</td>
<td>SPI master out / slave in aka <br/> PICO (peripheral in / controller out)</td>
</tr>
<tr>
<td>CLK</td>
<td>VSPI SCK aka GPIO 18</td>
<td>SPI clock</td>
</tr>
</table>
<p>Then three LCD pins can be wired to any available I/O, so I picked pins near the others I was already using:</p>
<table border=1 cellspacing=0 cellpadding=5>
<tr>
<th>LCD Pin</th>
<th>ESP32 Pin</th>
<th>Signal</th>
</tr>
<tr>
<td>CS</td>
<td>GPIO 1</td>
<td>SPI chip select</td>
</tr>
<tr>
<td>DC</td>
<td>GPIO 3</td>
<td>LCD data / command select</td>
</tr>
<tr>
<td>RST</td>
<td>GPIO 21</td>
<td>LCD module reset</td>
</tr>
</table>
<p>And finally the backlight enable pin, which <a href="https://files.waveshare.com/upload/e/ee/2inch_LCD_Module_SchDoc.pdf">the schematic</a> shows is pulled high / active so is superfluous unless you want to blank or PWM the backlight:</p>
<table border=1 cellspacing=0 cellpadding=5>
<tr>
<th>LCD Pin</th>
<th>ESP32 Pin</th>
<th>Signal</th>
</tr>
<tr>
<td>BL</td>
<td>GPIO 17</td>
<td>backlight control (active high)</td>
</tr>
</table>
<h3>Arduino Libraries</h3>
<p>Waveshare provides their own ST7789 and LCD graphics libraries but I overlooked those, so for what seemed like expedience I loaded the <a href="https://github.com/adafruit/Adafruit-ST7735-Library">Adafruit ST77* library</a> and <a href="https://github.com/adafruit/Adafruit-GFX-Library">Adafruit GFX library</a>.</p>
<p>I could not find, in <a href="https://cdn-learn.adafruit.com/downloads/pdf/adafruit-gfx-graphics-library.pdf">the documentation</a> or <a href="https://learn.adafruit.com/adafruit-1-44-color-tft-with-micro-sd-socket/wiring-and-test">tutorials</a>, the syntax for some fundamentals &#8212; to wit, I didn&#8217;t find documentation stating the syntax to instantiate a display object, nor documentation of (the correct) syntax to initialize the display object.  (I ran across what in retrospect incidentally sort of demonstrated these; but I would like documentation to expressly tell me how to use what I&#8217;m trying to use.)</p>
<p>The libraries come with example code and by examining <code>Examples from Custom Libraries</code> / <code>Adafruit ST7735 and ST7789 Library</code> / <code>graphicstest_st7789</code>, and with the help of <a href="https://forum.arduino.cc/t/esp32-wroom-32d-with-ic-st7789-tft/1343907/5">a forum post</a>, I was able first to get the graphics demo to run on my display and second to write my own code.</p>
<p>The library needs to know where things got wired up:</p>
<p><code>#define TFT_CS (1)    //  yellow wire<br />
#define TFT_RST (21)  //  brown wire<br />
#define TFT_DC (3)    //  blue wire<br />
</code></p>
<p>Then to be initialized with the right dimensions for this LCD:</p>
<p> <code>  // OR use this initializer (uncomment) if using a 2.0" 320x240 TFT:<br />
  tft.init(240, 320);           // Init ST7789 320x240<br />
</code></p>
<p>And then the demo works.</p>
<h3>My Demo</h3>
<p>Putting it all together into my own test:</p>
<p><code>#include &lt;Adafruit_GFX.h&gt;<br />
#include &lt;Adafruit_ST7789.h&gt;</p>
<p>#define TFT_CS (1)    //  yellow wire<br />
#define TFT_RST (21)  //  brown wire<br />
#define TFT_DC (3)    //  blue wire</p>
<p>#define PIN_BACKLIGHT (17)  //  grey wire</p>
<p>Adafruit_ST7789 mylcd = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);</p>
<p>void setup() {<br />
  pinMode(PIN_BACKLIGHT, OUTPUT);<br />
  digitalWrite(PIN_BACKLIGHT, HIGH);</p>
<p>  mylcd.init(240, 320);<br />
  mylcd.setRotation(1);<br />
  mylcd.fillScreen(ST77XX_BLACK);</p>
<p>  //mylcd.drawLine(0, 0, 25, 25, 65535);</p>
<p>  mylcd.setCursor(0, 0);<br />
  mylcd.setTextColor(65535);<br />
  mylcd.setTextSize(3);<br />
  mylcd.print("hello, world");<br />
}</p>
<p>void loop() {<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neufeld.newton.ks.us/electronics/?feed=rss2&#038;p=2400</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ESP32 Modules in Breadboards</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=2394</link>
		<comments>http://www.neufeld.newton.ks.us/electronics/?p=2394#comments</comments>
		<pubDate>Mon, 14 Apr 2025 22:56:08 +0000</pubDate>
		<dc:creator>Keith Neufeld</dc:creator>
				<category><![CDATA[Arduino]]></category>

		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=2394</guid>
		<description><![CDATA[A frequently-heard refrain is that ESP32 modules are so inconvenient because with their 1.0&#8243; spacing between header rows, in the standard installation, their footprint covers all but one horizontal row of holes on a breadboard; and kids these days like using fly-wire-style breadboard jumpers rather than trace-style breadboard jumpers (which would work underneath it). This [...]]]></description>
			<content:encoded><![CDATA[<p>A frequently-heard refrain is that ESP32 modules are so inconvenient because with their 1.0&#8243; spacing between header rows, in the standard installation, their footprint covers all but one horizontal row of holes on a breadboard; and kids these days like using fly-wire-style breadboard jumpers rather than trace-style breadboard jumpers (which would work underneath it).</p>
<p>This should be regarded as irritating rather than intractable.  I present here two workarounds and leave the discovery of more as an exercise for the reader.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2025/04/14/IMG_20250414_173039_0627_crop.jpg"><img src="http://www2.neufeld.newton.ks.us/images/electronics/2025/04/14/IMG_20250414_173039_0627_crop_mid.jpg" alt="ESP32 module installed on modular breadboard system" /></a></p>
<p>Option 1, remove one power-strip row from a modular breadboard and dovetail-pin that breadboard onto another.  Install the ESP module over the new &#8220;power gutter&#8221; and revel in the luxury of plenty of rows for connecting jumpers.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2025/04/14/IMG_20250414_173931_0636_crop.jpg"><img src="http://www2.neufeld.newton.ks.us/images/electronics/2025/04/14/IMG_20250414_173931_0636_crop_mid.jpg" alt="ESP32 module installed on modified breadboard system" /></a></p>
<p>Option 2, SAW THROUGH THAT and revel in the luxury of plenty of rows for connecting jumpers.</p>
<p>Footnote:  Use a hacksaw.  Its finer teeth cut without snagging like a wood-cutting saw&#8217;s teeth would do; I don&#8217;t want to contemplate the kind of workholding it would take for me to feel safe using a tablesaw or circular saw on this; and you would be so startled the moment a wood-cutting bandsaw&#8217;s teeth first engage in the edge of the plastic and the blade leaps toward you.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neufeld.newton.ks.us/electronics/?feed=rss2&#038;p=2394</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ESP32-WROOM-32 in Arduino IDE</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=2380</link>
		<comments>http://www.neufeld.newton.ks.us/electronics/?p=2380#comments</comments>
		<pubDate>Mon, 14 Apr 2025 20:13:11 +0000</pubDate>
		<dc:creator>Keith Neufeld</dc:creator>
				<category><![CDATA[Arduino]]></category>

		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=2380</guid>
		<description><![CDATA[Back in 2021 I documented the process of installing and selecting support for a particular ESP8266 into the Arduino IDE, in case it would help anyone else and as a reference for the next time I needed to do it myself. Well, here I am back again doing the same to bootstrap myself on the [...]]]></description>
			<content:encoded><![CDATA[<p>Back in 2021 I <a href="/?p=1919">documented the process of installing and selecting support for a particular ESP8266 into the Arduino IDE</a>, in case it would help anyone else and as a reference for the next time I needed to do it myself.  Well, here I am back again doing the same to bootstrap myself on the ESP-WROOM-32 aka ESP32-WROOM-32.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2025/04/14/IMG_20250414_171256_0612_crop.jpg"><img src="http://www2.neufeld.newton.ks.us/images/electronics/2025/04/14/IMG_20250414_171256_0612_crop_mid.jpg" alt="ESP-WROOM-32 board" /></a></p>
<p>My refresher on the basics came from <a href="https://samueladesola.medium.com/how-to-set-up-esp32-wroom-32-b2100060470c">https://samueladesola.medium.com/how-to-set-up-esp32-wroom-32-b2100060470c</a>, although he had to go through some steps I didn&#8217;t and vice-versa.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2025/04/14/Arduino-board-manager-Espressif-URL.png"><img src="http://www2.neufeld.newton.ks.us/images/electronics/2025/04/14/Arduino-board-manager-Espressif-URL.png" alt="Adding Espressif URL to Arduino IDE board manager list" /></a></p>
<p>First, go to <code>File</code> / <code>Preferences</code> / <code>Additional boards manager URLs</code> and add<br />
<code>https://dl.espressif.com/dl/package_esp32_index.json</code> to indicate another repository to search for board definitions.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2025/04/14/Arduino-board-manager-add-boards.png"><img src="http://www2.neufeld.newton.ks.us/images/electronics/2025/04/14/Arduino-board-manager-add-boards.png" alt="Arduino IDE board manager" /></a></p>
<p>Then <code>Tools</code> / <code>Board</code> / <code>Boards Manager...</code> to pick an available board bundle, start typing <code>esp32</code>, and click to install <code>esp32 by Espressif Systems</code> .</p>
<p>I&#8217;m installing this on my Linux workstation so I had to give myself permission to access the USB port, which was:</p>
<p><code>sudo usermod -aG dialout neufeld</code></p>
<p>To make that group change take effect, I was only supposed to need to logout; but doing so added me to the entry in <code>/etc/group</code> but didn&#8217;t activate the group membership when I ran <code>id</code> or tried to access the device file.  I had an OS update to apply anyway so I rebooted and all was well.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2025/04/14/Arduino-ESP32-board-selection.png"><img src="http://www2.neufeld.newton.ks.us/images/electronics/2025/04/14/Arduino-ESP32-board-selection.png" alt="Picking ESP32 Dev Module from Arduino IDE board selection list" /></a></p>
<p>Back in the Arduino IDE, <code>Select Other Board and Port</code>, start typing <code>esp32 dev</code> into the board search, and pick <code>ESP32 Dev Module</code> when it popped up.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2025/04/14/Arduino-board-selection-not-found.png"><img src="http://www2.neufeld.newton.ks.us/images/electronics/2025/04/14/Arduino-board-selection-not-found.png" alt="Arduino IDE board selection list with nothing picked" /></a></p>
<p>Weirdly, even with the USB serial port selected (and accessible), it complains that no boards were found &#8212; but it works.</p>
<p>Finally, <code>File</code> / <code>Examples</code> / <code>01.Basics</code> / <code>Blink</code> to make sure I can compile and upload code to the correct board.</p>
<p><a href="http://www2.neufeld.newton.ks.us/images/electronics/2025/04/14/Arduino-blink-define-LEDBUILTIN.png"><img src="http://www2.neufeld.newton.ks.us/images/electronics/2025/04/14/Arduino-blink-define-LEDBUILTIN.png" alt="Defining LED_BUILTIN for Arduino Blink sketch on board that doesn't define it" /></a></p>
<p>Blink relies on an LED_BUILTIN macro that&#8217;s not defined in this Espressif board spec.  <a href="https://forum.arduino.cc/t/esp-32-wroom-32-pin-allocation/1228704">This forum post</a> suggested pin 2 for the built-in LED on this board and adding</p>
<p><code>#define LED_BUILTIN (2)</code></p>
<p>did the trick.  Compile, upload, and I have a blinking blue LED next to the red power LED.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.neufeld.newton.ks.us/electronics/?feed=rss2&#038;p=2380</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AoC 2023 D8P1:  Traversing a Digraph</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=2371</link>
		<comments>http://www.neufeld.newton.ks.us/electronics/?p=2371#comments</comments>
		<pubDate>Sat, 09 Dec 2023 15:39:57 +0000</pubDate>
		<dc:creator>Keith Neufeld</dc:creator>
				<category><![CDATA[2023]]></category>
		<category><![CDATA[Advent of Code]]></category>

		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=2371</guid>
		<description><![CDATA[Day 8 part 1 gives us a directed graph of nodes with links to two (hopefully other) nodes and a set of dance moves to perform through the graph; how many steps to get from AAA to ZZZ at the end of a dance pattern? (A lot more steps if you stray into DDD, EEE, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://adventofcode.com/2023/day/8">Day 8 part 1</a> gives us a directed graph of nodes with links to two (hopefully other) nodes and a set of dance moves to perform through the graph; how many steps to get from <code>AAA</code> to <code>ZZZ</code> at the end of a dance pattern?  (A lot more steps if you stray into <code>DDD</code>, <code>EEE</code>, or <code>GGG</code>.)</p>
<p><code>RL</p>
<p>AAA = (BBB, CCC)<br />
BBB = (DDD, EEE)<br />
CCC = (ZZZ, GGG)<br />
DDD = (DDD, DDD)<br />
EEE = (EEE, EEE)<br />
GGG = (GGG, GGG)<br />
ZZZ = (ZZZ, ZZZ)<br />
</code></p>
<p>All one need do is make a hash of the nodes with their branches, then dance through it.</p>
<p><span id="more-2371"></span></p>
<p><code>my %index = ( L => 0, R => 1 );</code></p>
<p>The dance moves are specified as <code>L</code> or </code>R</code> and for no particular reason I decided to save the branches as arrays instead of hashes, so I prepare to translate dance moves into array indices.  Why on earth did I call this <code>%index</code> instead of <code>%dirindex</code> or <code>%dir</code>?  Because I had just woken up and it was time to do AoC?  Probably.</p>
<p><code>$_ = <>; chomp;<br />
my @instr = map { $index{$_} } split(//);</p>
<p><>;<br />
</code></p>
<p>I grab the dance moves, translate them from directions to indices, and toss the following blank line.</p>
<p><code>my %map;<br />
while (<>) {<br />
    my ($node, $l, $r) = /(\w{3})/g;<br />
    $map{$node} = [ $l, $r ];<br />
}<br />
</code></p>
<p>Then read in and save all the nodes.</p>
<p><code>my $count = 0;<br />
my $pos = "AAA";</p>
<p>until ($count % @instr == 0 &#038;&#038; $pos eq "ZZZ") {<br />
    $pos = $map{$pos}[$instr[$count++ % @instr]];<br />
}<br />
</code></p>
<p>Finally, start at <code>AAA</code>; take steps, counting as I go (and using the modulus of the number of dance moves in the pattern); and stop at <code>ZZZ</code> only if it's the end of this dance pattern.</p>
<h3>Full Program</h3>
<p><code>#!/usr/bin/perl</p>
<p>use warnings;<br />
use strict;</p>
<p>my %index = ( L => 0, R => 1 );</p>
<p>$_ = <>; chomp;<br />
my @instr = map { $index{$_} } split(//);</p>
<p><>;</p>
<p>my %map;<br />
while (<>) {<br />
    my ($node, $l, $r) = /(\w{3})/g;<br />
    $map{$node} = [ $l, $r ];<br />
}</p>
<p>my $count = 0;<br />
my $pos = "AAA";</p>
<p>until ($count % @instr == 0 &#038;&#038; $pos eq "ZZZ") {<br />
    $pos = $map{$pos}[$instr[$count++ % @instr]];<br />
}</p>
<p>print "$count steps\n";<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neufeld.newton.ks.us/electronics/?feed=rss2&#038;p=2371</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AoC 2023 D7P2:  Pseudo-Poker Hands with Wildcards</title>
		<link>http://www.neufeld.newton.ks.us/electronics/?p=2364</link>
		<comments>http://www.neufeld.newton.ks.us/electronics/?p=2364#comments</comments>
		<pubDate>Sat, 09 Dec 2023 15:14:56 +0000</pubDate>
		<dc:creator>Keith Neufeld</dc:creator>
				<category><![CDATA[2023]]></category>
		<category><![CDATA[Advent of Code]]></category>

		<guid isPermaLink="false">http://www.neufeld.newton.ks.us/electronics/?p=2364</guid>
		<description><![CDATA[Part 2 redefines J from jack to joker, making jokers wildcards when determining type of hand but the lowest value when comparing individual cards. This requires very little modification to the part 1 program: my $cardlist = "AKQT98765432J"; Change the card sort order; my $jokers = grep { $_ eq "J" } @cards; count the [...]]]></description>
			<content:encoded><![CDATA[<p>Part 2 redefines <code>J</code> from jack to joker, making jokers wildcards when determining type of hand but the lowest value when comparing individual cards.  This requires very little modification to the part 1 program:</p>
<p><code>    my $cardlist = "AKQT98765432J";</code></p>
<p>Change the card sort order;</p>
<p><code>    my $jokers = grep { $_ eq "J" } @cards;</code></p>
<p>count the jokers;</p>
<p><code>    ++ $tally{$_} foreach grep { $_ ne "J" } @cards;</code></p>
<p>omit the jokers when counting cards for type of hand;</p>
<p><code>    $ofakind[0] += $jokers;</code></p>
<p>and in this poker variant, simply add the count of jokers to the count of the most-frequent card when determining type of hand.</p>
<p><span id="more-2364"></span></p>
<h3>Full Program</h3>
<p><code>#!/usr/bin/perl</p>
<p>use warnings;<br />
use strict;</p>
<p>sub cardval;</p>
<p>my @hands;</p>
<p>while (<>) {<br />
    my ($cards, $bid) = /(\w+)/g;<br />
    my @cards = split(//, $cards);<br />
    my @values = map { cardval($_) } @cards;<br />
    my $jokers = grep { $_ eq "J" } @cards;</p>
<p>    my %tally;<br />
    ++ $tally{$_} foreach grep { $_ ne "J" } @cards;<br />
    my @ofakind = sort { $b <=> $a } values %tally;<br />
    $ofakind[0] += $jokers;<br />
    my $type = $ofakind[0] == 5 ? 6			#   5 of kind -- 6<br />
	    : $ofakind[0] == 4 ? 5			#   4 of kind -- 5<br />
	    : $ofakind[0] == 3 &#038;&#038; $ofakind[1] == 2 ? 4	#   full house -- 4<br />
	    : $ofakind[0] == 3 ? 3			#   3 of kind -- 3<br />
	    : $ofakind[0] == 2 &#038;&#038; $ofakind[1] == 2 ? 2	#   2 pair -- 2<br />
	    : $ofakind[0] == 2 ? 1			#   1 pair -- 1<br />
	    : 0;					#   nothing -- 0</p>
<p>    push(@hands, { CARDS => [ @cards ], BID => $bid, VALUES => [ @values ],<br />
	    TYPE => $type });<br />
}</p>
<p>my @sortedhands = sort { ${$a}{TYPE} <=> ${$b}{TYPE}<br />
	|| ${$a}{VALUES}[0] <=> ${$b}{VALUES}[0]<br />
	|| ${$a}{VALUES}[1] <=> ${$b}{VALUES}[1]<br />
	|| ${$a}{VALUES}[2] <=> ${$b}{VALUES}[2]<br />
	|| ${$a}{VALUES}[3] <=> ${$b}{VALUES}[3]<br />
	|| ${$a}{VALUES}[4] <=> ${$b}{VALUES}[4]<br />
} @hands;</p>
<p>my $sum;<br />
$sum += ($_ + 1) * $sortedhands[$_]{BID} foreach (0 .. scalar @sortedhands - 1);<br />
print "sum is $sum\n";</p>
<p>sub cardval {<br />
    my $c = shift;<br />
    my $cardlist = "AKQT98765432J";<br />
    return length($cardlist) - index($cardlist, $c);<br />
}<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://www.neufeld.newton.ks.us/electronics/?feed=rss2&#038;p=2364</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
