stoermelder / vcvrack-packone

Modules for VCV Rack
GNU General Public License v3.0
178 stars 40 forks source link

Problem using 8FACE with VCV Chords #74

Closed PaulPomeroy closed 4 years ago

PaulPomeroy commented 4 years ago

20191205A5-sh.vcv.txt

This is a weird one. I'm using 8FACE with VCV Chords. I have a set of 10 chords (presets) both loaded in CHORDS and stored in slot 2 of 8FACE. I have a different set of 10 chords stored in slot 1. 8FACE is set up to switch between slots using notes in the C4 range. I'm using a 4-step sequencer (just to the left of the CHORDS module) to send three C#4 notes (in steps 1-3 to select slot 2) and then a C4 (in step 4 to select slot 1). The problem starts when 8FACE is told to change slots. For some reason, it is changing the notes of the chord in CHORDS' Preset 1. The first chord in slot 1 is a Cm7 (C4, D#4, G4, A#4). But when step 4 of the sequencer sends a C4 note to 8FACE the first chord it loads has been changed to a Dm7 with the following notes: D4, F4, A4 and C6 (when you play the patch you will hear that high C6 ring out). And then, when the sequencer goes back to step 1 it sends 8FACE a C#4 to switch back to the original set of chords and the first chord in that set is now rewritten. It should be a CM7 (C4, E4, G4, B4). Instead, it's now (usually) an EM7 with the forth note several octaves higher. (However, it has at least one time changed that first chord to an AM7 with the first note 2 octaves lower.)

As I said, it's a weird one. I've looked in the patch file and 8FACE has the right notes for all the chords in both slots. I've no idea where these "new chords" it uses are coming from.

stoermelder commented 4 years ago

Hi Paul, I will have a look but most likely this is an issue with Chords. 8FACE loads essentially a preset of the module, so first thing to try would be loading presets of Chords manually and check if these work as expected.

PaulPomeroy commented 4 years ago

Thanks, Ben. I tried loading chords (saved in a CHORD Preset) into CHORD as the patch was playing and things appeared to work fine but I'll need to create another simpler patch to test this. The timing of the load could be significant. What might be happening is that, because CHORDS is getting told to advance to the next chord at exactly the same time (i.e., using the same clock pulse) that signals 8FACE to load in a different set of chords, CHORDS is somehow mangling the first chord in the new set. It's odd, though, that it is "mangling" things so musically. By that, I mean that the altered chord could be something really off-key but it's not. It actually sounds quite nice, including the one note that is several octaves higher than usual. It stays in the correct mode (Major or Minor) and stays with the right voicing (a 7th chord). It's weird, but it's a good weird (LOL).

stoermelder commented 4 years ago

I just checked your patch and it is weird indeed. There is definitvely something going on in Chords. On the left is the preset that is loaded, on the right the preset that is active after load, the first chord is different?

You're right that it has something to do withing loading and advancing the same time. I added Bacon SampleDelay set to 16 samples between the clock and ADV of chords, then it works how it should.

image

PaulPomeroy commented 4 years ago

Thanks, Ben. My guess is that part of that incorrect first chord is due to it loading the notes for the chord in Preset 5 (4,8,11,15) into the wrong location (i.e., Preset 1). That 27 it comes up with for the 4th note is a little harder to figure out. It's probably not a coincidence, though, that 27 in binary is 00011011 and 11 (eleven) is 00001011 -- so something between the "advance" and "reload" processes is, perhaps, flipping that one bit? That's my best guess.

Again, thanks. I appreciate your time (and your modules!).

stoermelder commented 4 years ago

I will create a feature request for Rack for handling these issues a better way, maybe something can be added for v2.

PaulPomeroy commented 4 years ago

Thanks, Ben. I remember, from decades ago, now, spending a lot of time chasing down a bug in some automation software I'd written. It turned out to be something caused by a small section of code that tripped on itself when running on a multi-threaded system. The solution was simple: we added a thread-locking function to make the code wait its turn, but it took a long time to chase down what was actually going wrong so we could fix it.

stoermelder commented 4 years ago

Yes, the issue is some kind of similar and has to do with synchronization. To be honest I'm surprised that almost no module causes problems with 8FACE as it does an unsychronized load of the preset. Currently there is no hook or event or something in Rack's engine for doing stuff between samples. Maybe Andrew can address this although it will be used mostly by my modules :-)

stoermelder commented 4 years ago

Ah, and thanks for your donation, Paul!

stoermelder commented 4 years ago

https://github.com/VCVRack/Rack/issues/1656

PaulPomeroy commented 4 years ago

FYI, I replaced the clock divider I was using with Holonic Systems' "Gaps divisions" module, set to "even" mode and cabled to trigger the 4-step sequencer every 10th clock pulse. And ... the problem went away -- the two different sets of chords are loaded in by 8FACE with no errors showing up in CHORDS. The change must have altered the event sequence enough to let CHORDS load in the new set of chords before processing the "advance" signal. 20191205a7-sh.vcv.txt