Searching an intelligent 4 input selector box

Started by Elijah-Baley, December 07, 2024, 04:04:16 AM

Previous topic - Next topic

PRR

Parallax BASIC Stamp is a teeny controller for NON-programmers. Yes you have to tell it what to do. No, it isn't traditional programming, more like a "How To" for cooking or stage setup.

OTOH, if you can figure how your switched jack can tickle the CLK input of the 4017 when it hits an unused hole, it may be simple hardware. (I can see it but only with much more complicated jacks than we use.)
  • SUPPORTER

ElectricDruid

#21
Quote from: Elijah-Baley on January 03, 2025, 04:05:48 AMSo, looking at the ElectricDruid's schematic, there's just some changes. I kept the input caps 1uF and the 10uF output, to avoid any low end cut. I reduced even R4 560R to 100R, for a little bit more transparent signal.
The resistor in line with the output is to help the op-amp maintain stability when there's a decent amount of cable (and therefore capacitance) plugged into the output. Reducing it reduces that margin, but unless you plug a long cable in, you'll *probably* never notice.

QuoteI guess all these changes make a tiny difference.
They do. The original way was done that way for a reason.

QuoteAnother change is about the biasing of the TL071, not for my choice, but due to the layout design. Two 2.2M resistors on the 9v and on the ground. I think that is ok (or even better?).
It's almost certainly not better. Think about what happens to power supply noise with the new way - exactly half of it is coupled directly into that input. The other way with the voltage divider includes a capacitor that filters this power supply noise and provides a low impedance path to ground. Here's a reference:

https://www.analog.com/en/resources/app-notes/an-581.html

Will it work with the 2M2s? Yes, it'll work. But in my view these changes are not really "improvements", sorry. I understand the need to get things to work on a stripboard layout, and I know from experience that that isn't easy, so perhaps a few compromises have to be accepted. You choose how many - it's your project.

HTH

R.G.

Only mildly more complicated is Great Cow Basic ("GCB"). It's a true compiler, and accepts more-or-less standard Basic syntax.

I mostly quit using anything else for PICs because its just so fast and easy. I once programmed an eight loop programmable any-order FX switcher in GCB. For stuff like sensing foot switches, it's plenty fast enough.

The programming for this function is incredibly simple for everything except switch debouncing. Mostly, if you can write down how you want the footswitches to act, in English, the Basic code just falls out - with one exception, that being switch debouncing. I used a variant of a vertical adder routine to sense up to eight inputs simultaneously, then debounce them all simultaneously, but independently.

If I was writing this app, I'd pick a 14 pin PIC, like perhaps the 16F15323, about US$1.50 in one. Then:

====
' initialize a bunch of PIC specific stuff; this is chip dependent
' initialize a bunch of variables used in the program; here is where any memory of previous state would be raised from the dead
' set up a 10mS interrupt on a timer, so that the program has to sample footswitches every 10mS

MAIN:
IF footswitch_state was changed by the switch debouncing THEN change the actual output pins, move the previous state to a variable so we can tell it changed

GOTO Main:

ON_INTERRUPT:
' 10mS tick happened
' read the input pins
' use input pins' state this interrupt to compute any changes
' IF any switch was debounced to a new state, write it into the variable that MAIN checks for changes
' update previous states so we can tell something changes from now
RETURN
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

PRR

#23
> Great Cow Basic

Good stuff if you know what a PIC is. The STAMP series pre-solves many detail that confuse beginners (even me, when not working on PC class machinery). You pay more for board and cord but it is plug and play. To each her own, of course.
  • SUPPORTER

PRR

#24
> ....It's a true compiler, and accepts more-or-less standard Basic syntax.

For jobs like my blower-control, and Elijah-Baley's switch-fitting, most BASIC syntax is over-kill, and thus frustrating to the first-timer. GOTO is NOT "harmful" if you only have a dozen lines and don't have experience in thinking IF..THEN..ELSE. Compiled or interpreted is purely an implementation detail which should not be left to the ignorant.

Liam posted a deep-thought piece:
https://www.theregister.com/2025/01/03/reevaluating_basics_legacy/
I don't agree with half his thesis-- he may not have gone far enuff. And today I don't care which company to blame for BASIC's supposed downfall. But there is food for thought.

(Yes, I think FORTRAN 58 is, after machine-code, the one true language; why do you ask?)
  • SUPPORTER

FiveseveN

While we're still on the subject, there are "visual programming" platforms for Arduino (and others) that let you bypass the coding entirely:
https://xod.io/
https://www.visuino.com/
http://www.visualino.net/
https://mblock.cc/
https://github.com/BlocklyDuino/BlocklyDuino-v2
Quote from: R.G. on July 31, 2018, 10:34:30 PMDoes the circuit sound better when oriented to magnetic north under a pyramid?

R.G.

Quote from: PRR on January 03, 2025, 09:40:54 PMGood stuff if you know what a PIC is. The STAMP series pre-solves many detail that confuse beginners (even me, when not working on PC class machinery). You pay more for board and cord but it is plug and play. To each her own, of course.
I had not looked at the BASIC Stamp for a long time. The real ones are expensive ($13 to $29) but the clones are down at about $6. The Arduino Nano is about the same, with clones down at about $5 or so. Arduino stuff generally needs programming in what amounts to C++, but much of this is hidden inside the Arduino IDE.

Over the years, I've become language agnostic. I write down what I want to do in kind-of-English statements that mimic the programming statements I'm used to, like GOTO, GOSUB, IF-THEN-ELSE and so on, and then get out the specific language manual and start transcoding.

The joy, and at the same time curse, of BASIC to me is its simplicity. Need a new variable? Just type in a new variable name and assign a value. The curse of that is that it allows you to subtly hose up something you did elsewhere in the program.

A whole lot of the "advances" in newer languages is designed to force the programmer to not make subtle mistakes by making the compiler refuse to play along. Declaring variables and types is actually good programming hygene, even if it's infuriating. I cursed at Arduino/C++ scope declarations a lot, but finally figured out that this was freeing in many ways.

If you even want to have fun reading about computer languages, look up the "Whitespace" language, which has all of the language syntax in non-printing characters.  :icon_lol:
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

ElectricDruid

Quote from: R.G. on January 05, 2025, 04:18:35 PMA whole lot of the "advances" in newer languages is designed to force the programmer to not make subtle mistakes by making the compiler refuse to play along. Declaring variables and types is actually good programming hygene, even if it's infuriating. I cursed at Arduino/C++ scope declarations a lot, but finally figured out that this was freeing in many ways.
I agree, but I've still never been able to get on with C's "header" files. That just seems like it's *you* doing work for the compiler's benefit. Like "I'll tell you what I'm going to do, so you don't have to work it out". It's a damn computer! Working stuff out is what it's *for*!! Do another pass of the code if you want to see what variables and functions I've declared. Grrr. Other languages don't seem to need this "ahead of time" declaration of every bleedin' thing, so it's not "necessary" in that sense. Bugs the hell out of me. Plus you finish up having to do a load more pointless statements so as not to include the same header files multiple times if several files in your project all need the same stuff. It's really the worst way to try and "organise" things. Dozens of files, all with another file that says what's in them, and then a ton of dependencies between them all. Nightmare.

Ok, sorry...please feel free to get back on topic and I'll shut up!!  ::)

Elijah-Baley

Quote from: ElectricDruid on December 10, 2024, 07:29:24 AM

I'll stay on this schematic.

I'm thinking about to add a rotary switch to connect the positive of the 1N4148 to the common pole and set the reset connect the other pole to (Not Q0 and Q1) Q2, Q3, Q4 or Q5. In this way, when you switch on Q2 and plug just one guitar on that channel you have in the loop just Q0 input (A), Q1 (nothing plugged) getting mute signal, or at least this is what I wish, and it starts again.
Then, if you plug two guitars, input A and B and the switch is on Q3, you got Q0, Q1 and Q2 mute and it starts again. And go on until getting four guitars, input A, B, C, D and mute.

I hope this is clear, and it is possible to do.
«There is something even higher than the justice which you have been filled with. There is a human impulse known as mercy, a human act known as forgiveness.»
Elijah Baley in Isaac Asimov's The Cave Of Steel

amptramp

Do you have any plans for noiseless switching in this project?  A lot of effort is spent in some stompboxes to ensure switch pops are kept to a minimum level.  There are several ways of doing this:

1. Use of JFET switches that can be slowed down so the switching takes place at a lower frequency than the audio signal.  Only possible with a CD4007 in CMOS.

2. Delaying the switching until the original signal and the new signal are at the same voltage so you are switching from one voltage to the same voltage on the next selected channel.

Switch pops are not always a problem.  If the stompbox is on or off for the entire song, the only switching is between songs and that is usually not a problem.  But if you are switching an effect during the song, you might want to consider reducing switching noise.

Elijah-Baley

I thought the momentary footswitch (normally open) wired like in the ElectricDruid's schematic, as in the paulinthelab on, was just fine.

This device is just to change the guitar between a song an another, I hoped there's no bump or pop with the footswitch.

And now I hope there's no pop changing the reset position with the rotary switch, I never worked with this circuit, I still have order all the materials. But, thinking about it, once you select the number of inputs with this rotary switch before start to play, it remains for all the session, you don't need to change it.
«There is something even higher than the justice which you have been filled with. There is a human impulse known as mercy, a human act known as forgiveness.»
Elijah Baley in Isaac Asimov's The Cave Of Steel

ElectricDruid

Ron, you'll see from the schematic that the inputs and outputs of the 4066 switch are biased to the same level, so unless you switch while there's signal going through it, the two sides of the switch should be at similar voltages. It's true that it won't neceesarily be silent if you have a signal on either the channel you switch from or to - that would require the kind of soft-fade you're describing. But for changing guitars between tracks it should be fine.

The reset switch shouldn't affect the audio path at all. It's purely part of the control circuit. The exception to this is if you happen to be on "Input 4" (say) when you switch to "Only 3 inputs", in which case the circuit would change input - but that's the same as you switching it yourself, as above.

HTH

Elijah-Baley

Thank you guys.

I have another question now. My friend has these four guitars, of course with different output level, so it could be useful have a kind of Volume or gain control.
I'm planning to turn the final buffer stage in a boost. The rotary switch has two poles, so I want to use the second to switch the pots in the feedback loop, one for every channel. I just did once with an AB box without any issue, so I assume do it with four channel should be fine, too.
And maybe add a Volume Master at the end of the circuit.

I'd prefer have four boosted circuit with a Volume pot for every channel to boost and cut the output, and a single Master Volume. But I guess I need more switching part.
I was trying to draw a schematic with a four boost in front, then I thought to use an unique boost with the four output, and switchable gain pot, in front to go into the CD4066. But I'm not sure if was ok push that.

What's a cool solution to control output for every single channel?
«There is something even higher than the justice which you have been filled with. There is a human impulse known as mercy, a human act known as forgiveness.»
Elijah Baley in Isaac Asimov's The Cave Of Steel