The Science Lab

This is the best thread idmf has ever had…imo.

1 Like

Yeah, I’m going to have to debug it for sure, and I still don’t know the value of these photoresistors yet so that’s the best place to start. I’m pretty stupid about the hardware end (I think I’ve only been doing that part for about a year now, IIRC?) so it may or may not make sense. I just have the circuit backed up with a 1K (which may or may not be doing more harm than good) and still trying not to fry things :D.

Yeah, I kind of feel the same way so far. I want to keep going in some direction, but that path usually presents itself when the time comes. It’s really hard at my point in the journey to know where it actually leads, but I could see it being a lifelong learning experience, whether it really accomplishes or amounts to anything. But I’m not the type to get easily frustrated or overwhelmed with options (something tells me you might be the same way), so that’s where the liquid coffee motivation comes into play. :smiley:

Sometimes just dipping into something a little bit sparks interest in multiple areas though, so if I can just get the job done with cheap-ass parts I’m usually happy enough with that. Even if it takes like 5 times to upload a sketch, and things are constantly going wrong. Maybe that’s part of the fun? I’m still wondering about that one.

1 Like

Some would say I’ve been using the ‘what did you create today’ thread as an unauthorized dumping ground for this stuff even before my last ragequit (so, possibly years now?), but I kind of just wanted to do this as a courtesy to people posting real, quality music without having to scroll past my bullshit all the time. And of course, I’m always secretly hoping this will encourage others to get started (or start post their creations), too!

I never know how many people there are on the boards (here, or in any other community) who are into the ‘outsider’ stuff until I poke around, either. It always seems like a stupid idea to start a thread (in my head) because it’s so close, yet far away from the usual fare. Obviously most of this still has to do with creating music, but it’s hard to gauge just how nerdy most people want to go with it :smiley:

1 Like

Honestly, the only things I’ve kept around long term are some little piezo amps, a couple of modular modules and some pedals. I tear stuff apart and scavenge parts constantly, so I think I’m more of a tinkerer than a producer. I guess I get more of a kick out of knowing how it works than actually using it. It scratches that curiosity brain-itch more than anything.

I think working with substandard parts and setup is a useful part of the learning curve. I could look up a list of $500 worth of tools and parts and projects that might make life easier and be lots of fun, but how do I know that I even want them or how they work? I also wouldn’t appreciate the fact that some of it’s useful because I was never in a position to not have it. And when I decide all this shit is stupid and I just want to make music, I’ve got half a grand worth of parts and gear sitting around. “Buy what you need after you’ve actually figured out that you need it” has been my credo.

Case in point, go splurge on a legit Sparkfun Arduino when you can, preferably one like a Pro Micro or Leonardo that has built in USB/serial/HID capability (anything with a 32U4 chip). It’ll tell you 1. is not having to run extra software worth it to you and 2. does it fix your sketch upload problem. Now that you’ve slogged through both those things, buying the upgrade will tell you whether you’re fine like you are or you’re never going back to that shit because the grass is greener when you spend a bit more. Or just get an offbrand Pro Micro that gets you the HID solved, and if the sketches work/don’t work, you’ve narrowed the problem.

Another example is I know a lot of audio hobbyists thirst on an oscilloscope to look at their waveforms. Ends up that 90% of troubleshooting can (and should) be done with a multimeter and the scope is both a waste and a hinderance. It has it’s place, but running out and buying a $500 Rigel when you’re just getting started is buying a pretty paper weight - you should buy it when you’ve exhausted every other possibility and absolutely know you need it, because that’s when it becomes legit useful.

Anyway, that’s my take on it. Every time I fix a dumb problem or work around an issue or confirm that a thing really doesn’t work, I’ve learned something I can hopefully take forward. I’m all for spending money or time resolving reoccurring headaches that keep me from doing the part I enjoy, but I feel like a big part of the learning curve is identifying those things in the first place.


For the photoresistors, if you have a multimeter just attach one end to each lead and read the ohms with it in the dark and again with a bright light on it. Maybe one more time in general room light to give yourself a midline. It doesn’t have to be super accurate, just enough to ascertain the ballpark figures (1k, 10k, whatever).

If you don’t have a multimeter, I’d definitely recommend getting one. That’s a cheap piece of gear that keeps on giving. :smiley:

1 Like

I can vouch for needless oscilloscope lust being a thing. Sometimes I wonder how well the USB versions compare, since they’re usually a lot cheaper. But I’m also the type to use simulators (where applicable and able) when things aren’t working right, which can sometimes have their own built-in scopes. One that I have around even allows you to import Arduino libraries and use them however you please with emulated hardware, and I think that’s more my speed for debugging (if not even moreso learning), provided the emulation / simulation is accurate enough.

I’ve actually never heard of the Pro Micro, but it looks like they’re cheap which is awesome! I’m really curious about that now, because I almost think I get less trouble with my Mega ever since installing legit drivers, and I should probably fish around for things like that more frequently. I’ve been known to deem something completely useless until someone recommends grabbing official drivers, and then it works like a charm :smiley: . But some of these boards that I have (especially the Leonardo) are definite barely-working trash and should probably just be thrown away one day.

I’m definitely going to test both of those photoresistors just to get an idea. What’s weird is that the original range (obviously mapped later for MIDI use) was something between 450 - 850, which was way out of the 0-1023 range I usually get from other sensors and potentiometers. This probably doesn’t mean a whole lot in a vacuum, but I thought it was a bit strange nonetheless!

1 Like

Yeah, scopes are a whole thing. They’re great for a real-time look at what’s happening under the hood at a specific point in the circuit (visual version of an audio probe). The real use case is when you’re building a stand alone thing and need to see how it compares to the expected signal (ie actual vs simulated). They’re for when you care about what the signal is, not whether it’s there or how big it is (which is like 99% of troubleshooting).

USB scopes are passible but not great until you step up a few notches. The general consensus is you want 5x whatever signal you’re trying to measure, so ~20kHz * 5 = 100khz for audio, which literally any scope will do, even analog ones from the '50s. The cheap ones will give you 10Mhz which is plenty for most audio, but the input voltage is usually small and they have a lot of processing lag and slow sample rate. The most common USB one around is the Hantek 6022BL for like $90, but it maxes out at 5.5V input. God forbid you’d want to do anything with a 9V circuit (like a guitar pedal). If you’re only ever going to look at little 5-10V circuits a slightly more expensive USB is probably fine, but if you ever step up to anything more powerful you’d need a bench scope (even the entry level ones can read mains voltage or tube plates without breaking a sweat). A decent USB scope is probably $150, and I’d guess you could get a used bench scope for $200-250 on eBay.


I think those Pro Micros are a real sweet spot if you don’t mind soldering your own headers. They’re small and cheap enough to box up, have USB/Serial so you can skip all the Hairless crap, and have plenty of I/O. You’re not going to emulate a huge synth with one, but for things like control interfaces they’re great.


I think it may potentially tell you something. A standard pot is off (0V) when it’s all the way one way, so the code is expecting 0V = digital 0. My limited experience with photoresistors is they don’t close completely like a wiper pot, so unless you’re setting your reference voltage higher, pulling down the signal, or adjusting the low end digital variable to expect something over 0V, you’re not actually going to get 0 in the software. Similarly, there’s some sort of variable for the top end voltage to equal 1023 (ie 5V = 1023).

If you’re getting something in the range of 450-850 in software, my guess is the signal coming out of the resistor is like 2V-4V instead of 0V-5V. Something like that. I’m assuming whatever code is set up for 0V-5V or similar. You should be able to tweak those numbers in the code to give it better range based on what it’s actually doing.

This is a great spot to get a multimeter out. Set to volts, black on ground, red before the photoresistor and take a reading. That’s the voltage coming in. Then test after the photoresistor, voltage out (at a specific light level). In fact, that’s an easy way to actually measure the photoresistor, just apply a little Ohms Law (V = IR) to get values at different light levels. But it should at least give you the ballpark range of what the Mega is seeing and allow you to adjust the voltage/digital range accordingly.

2 Likes

Just wanted to update this in case anyone is still interested! I want to kick this up a notch in 2024! :smiley: . I’m also going to put a TL;DR at the bottom because this is a lot of autism in one shot. Bare with me.

As per @Artificer’s suggestion, I’m considering picking up some ARM-based boards over the holiday so that I can prototype not only MIDI devices, but possibly even weird DAW macros or actions with smooth HID integration. Honesty, this could open up a whole new dimension of musical weirdness (is this music anymore? I don’t know). If anyone else gets inspired enough to do weird things, please feel free to join in on the fun :smiley: .

Oh, and if anyone’s got some (more) good dev board recommendations in the under-$50-ish range, feel free to send them my way. I’m usually looking for the cheapest ones that will enable me to horse around well enough, because as we all know, quantity isn’t everything… but sometimes it’s fun to have a variety on hand!

Also, some bonus content (if there’s enough interest for it):

Over the past year (and more specifically, very recently) I started ‘developing’ (is that the word? that sounds more professional than what I do) modules for VM (Cherry Audio’s modular synth, it’s technically free BTW), so now I have the ability to just pull whatever data I want straight into janky-ass DIY modules. I think this is going to make experiments more fun, because rather than using loopbacks and shit that other people made, once I’m able to emulate HID (like MIDI), I can just pull everything I’m sending over via the MIDI libraries into specific modules without having to string up a whole bunch of shit like christmas lights.

I’ve also seen a few users talk about getting into Filter Forge over the past year or so, and while I can’t really integrate development boards into this one (or, can I? :thinking:), I’d be down for doing better workflow and scripting videos if anyone’s interested. And on the topic of Lua scripting, I wouldn’t rule out experiments involving Renoise, UVI Falcon and things that technically will interface with development boards if I play my cards right.

On that note, getting things like Sonic Pi and Tidal Cycles to talk to makeshift MIDI controllers can’t be ruled out, either, since they both take incoming MIDI messages. So depending on how retarded I want to get, this could be another avenue worth exploring.

So yeah, if anyone has suggestions for the lab or wants to do some of their own shenanigans, drop them here :smiley: . I’m also no expert, but if anyone wants to get started with modular or any of that stuff, I think that could be encapsulated into our little ‘science lab’, too. Because here in the science lab, we throw shit at the wall and see what sticks™

TL;DR:

  • Getting some better dev boards (probably)
  • Making modules to interface with them
  • Other things involving Lua, livecoding and other scripting shit
  • There are no stupid questions
  • ???
  • Profit Net loss!
3 Likes

I’ve been sick as hell (some flu-like shit) since chirstmas, but santa delivered on his promise and I got a whole bunch of ARM-based boards and even a Pi 3 clone to do more experimenting on. @Artificer was dead on about doing things this way, because I fired one up (Metro M0 Express) and couldn’t believe how much easier it was to just make quick iterations to the sketch without having to close everything down, make way for the loopback to stop conflicting with Arduino’s serial console and deal with a bunch of other nonsense.

Just being able to update and fix bugs on the fly like this makes it so much easier, but I’m kind of excited to try out making really janky producer-friendly macro pads and things like that which aren’t strictly related to just MIDI, even though MIDI is probably the main focus for a while.

If anyone has cool music-related Pi 3 ideas, I need some of those, too! I haven’t successfully flashed the SD yet (aside from the CLI-based OS I accidentally downloaded without looking), but I’m working on getting that (AML-S905X-CC) up and running next.

2 Likes

Glad to hear it worked out for you! The rapid iteration was a revelation to me as well. It’s probably also closer to something you’d want to box up and use or sell. All the kludgy HID-hack stuff is a mess, and while it shouldn’t stop someone from learning or playing around, it probably also shouldn’t be part of an end product. Plug-n-play and all that.

I’m honestly not sure what you’d do with these in the audio realm besides MIDI. Maybe some simple control voltage stuff. In my experience it’s awfully hard to do much real time processing with them given the limited clock rate and instruction set, though maybe the newer boards are more capable. I think the real magic comes from what you stick on either side of the boards - the physical controllers themselves and what they’re controlling. Building some cool custom controllers from things like linear encoders sounds like a neat Rube Goldberg way of playing tunes.

2 Likes

Impractical projects, of course!

I’m still kind of marveling at the potentials and possibilities, but I’m considering the idea of something as silly as controlling Pyo (a DSP library) headlessly with external controls or something, either by loading scripts with the flick of a button or manipulating running audio threads (if this is even possible, which it yet to be determined) with joysticks or something like that.

Although these can be potentially done from within one system, I’m really obsessed with the part where this thing has an audio jack on it and the others don’t :smiley: . And sometimes the really stupid ideas lead to even better realizations, so if I get that far I’ll reassert the idea that almost anything is possible. Having a standalone DSP machine (might need a hat for some inputs, though) would make me feel like I had a shitty version of an Organelle on hand, which could be kind of hilarious and amusing.

But as you mentioned, I might need to upgrade boards to actually make this a reality. If I got a very early prototype of this running though, I’d be just as happy

2 Likes

I guess that’s what I meant by MIDI, or more generally a ‘control surface’…like something to control another thing. Most of the time I think that’s via MIDI or maybe CV, though I suppose with HID you could do keyboard interrupts or something based on voltage change? Definitely some options there, but my point was that these things are good for control but don’t have the firepower for complex processing/generation/logic in the way a ARM chip does.

It’d be similar to using Arduinos for home automation - they’re great as a sensor (omg there’s water/i sense motion, turn on the lights, etc) that feed back into the main system, but aren’t powerful enough to be the main system, where people will run a RaspPi or VM or whatever.

That’s not to deter you in any way from trying it (and at the least it’d be a great learning experience), more just a heads up about the approaching brick wall if you expect too much from those little SoCs :smiley:

2 Likes

Yeah, you’re definitely right about this.

I think for the most part (once I get better at controlling a headless Linux system, which is a WIP for me right now), testing the actual boundaries of the board will be the next step. An upgrade is eventually going to be inevitable at some point (I hear the Pi 5 is pretty awesome?), but coming up with smaller projects that actually fit into the confines of this board will likely prove to be quite an awesome sandbox when I get there. I’m sure there are a lot more possibilities than I can currently imagine, but I need to learn just a little bit more.

I did manage to successfully flash, SSH-into and run some basic-bitch scripts on it (the AML), but the extra incentive to actually learn my way around the command line is kicking in right about now. This is like a whole new world of excitement and weird possibilities, though.

I needed a good (8-channel) stereo mixer but couldn’t afford one, so I started thinking about whether it would be possible for me to get past my Java fear again (gulp) and make one from scratch.

Surprisingly, yeah, and I learned quite a lot in the process and feel a little better about doing it again. So afterward, I decided to make a second incarnation that acts as a VCA, too – when you plug up her holes (pun intended), you can really make her squeal (ok, in all seriousness this just means you can put an EG or LFO on there. It’s simple, but strangely a stereo version just doesn’t exist in VM yet… until now!).

UI design is fucking hard, by the way. I thought I was kind of decent at graphics but it goes way beyond that, because you’re usually limited to whatever’s in the GUI bank. Even if you create your own assets externally (I do the skins in Filter Forge, for example), it’s always hard to scale them just right. You’re almost better off using the internal ones and just figuring out how to make them cohesive, if possible.

Point is, if I ever get a dev license (you have to pay for it, which sucks) I’d like to release shit like this for free so that I could just give them away here, and maybe even make cool little helper modules for people getting started with modular. VM is technically free all the time, so you’d be able to just grab this stuff and use it.

Coming to a DAW near you, maybe by 2025? :smiley:

I also have a pretty huge backlog now with about ~25 releasable modules, plus I’ll inevitably end up doing Youtube manuals on each of them, so when they drop, they’re going to drop hard!

3 Likes