1 (edited by Shiru 2017-02-28 13:40:23)

Topic: General thoughts on a native Arduino engine

Thinking on what and how to do an Arduino specific 1-bit engine.

Feature set does not seem too important. It could be something like a scaled up Tritone or Phaser, with more channels, with ability to play tone or noise. It needs to support things that are difficult in ZX engines, such as clean vibrato, portamento, and maybe 'instruments' (fx tables) in general.

There is a major issue that stops me at the moment, the authoring tools. We can't really make music for engines with any complex instruments system using an XM converter. We can't really emulate Arduino to hear authentic sound while making music - well, we could make a whole dedicated tracker with AVR emulator, but that's a ton of work just to start. An VSTi can be made that will generate more or less similar sound, but this would kind of defeat the whole point, because such VSTi would be self-sufficient and the sound won't fully match.

One idea is to make MIDI interface, just as people asked, and control the Arduino with a MIDI-enabled DAW, to be able to use existing tools for composing and hear fully authentic sound in the process. This, however, requires to have the hardware and two MIDI interfaces (on the PC and Arduino's MIDI Shield, which is barely obtainable here and costs more than Arduino, by the way).

Yet another idea is a VSTi again, but this time one that would just emulate AVR and loaded firmware with the engine. Again, lots of work, but at least the whole Arduino thing won't be redundant in this case.

Any MIDI-related approach also makes it difficult to create instruments, it has to be done with SysEx and a custom tool. Or just limit a composer to use pre-defined patches.

website - 1bit music - other music - youtube - bandcamp - patreon - twitter (latest news there)

Re: General thoughts on a native Arduino engine

I think some MIDI solution would be preferable because of its potential impact. Would it be possible to ditch the Arduino MIDI shield and just decode the MIDI messages directly on the Arduino, using one of the digi ports? It would cause some additional load on the CPU of course, but on the other hand there's no need to load sequence/pattern data any more. As far as instruments go, yes, they could be pre-defined patches, but the engine should also make best use of the available standard Control Change messages, which could be linked to settings of duty, vibrato, etc.

3 (edited by PROTODOME 2017-02-28 19:04:55)

Re: General thoughts on a native Arduino engine

So I've been working with AVR 1-bit stuff over the last year as part of my PhD. I knocked up this incredibly basic 1-bit MIDI synthesizer in C a few months ago for a live performance. I've uploaded the code / schematics here if it's of any use. It uses the Arduino MIDI Library.

Example output here.

All of this is incredibly rough and originally made for my own benefit / reference. If you're using an Arduino you can ignore most of the schematic as this section below is basically the Arduino MIDI shield. You can build it yourself for like £5 (if not less).

MIDI IN circuit

The audio output circuit is rough, with no isolation, DC offset correction or lowpassing. Basically, just be aware that, while you can probably run a line in to most stuff, this is not 100% reliable or safe. If in doubt, headphones will do you absolutely fine. Also I personally love hearing the crackly 'brightness' of the upper harmonics, but add RC filter to taste.

Like I said, I knocked this up quickly so the code isn't commented, efficient or organised particularly sensibly. If there's interest in this I don't mind going through and commenting, but, Shiru, I think you've got a waaaaay better tone generation system in your other routines, so you could probably just slot it in (keeping aware of timer conflicts with the MIDI library, if you choose to use it). Additionally, I don't mind uploading better schematics, STLs for the 3D printed case etc.

Feel free to amend. At some point I was going to add pitch bend support, ADSR enveloping, vibrato and more effects, but it wasn't needed for the original project.

I'm a total n00b at all this, so any suggestions / pointers would also be very much appreciated.

EDIT -
If you fancy playing around with the synth, CC#1 is decay / sustain (it was originally two separate controls, but the difference between the two wasn't great enough) and CC#2 is 'volume', where the pin-pulse output is interleaved with silence. Channel 1 is pulse waves, channel 2 is PWM drums.

ANOTHER EDIT -
I know the Teensy can appear as a USB MIDI device, so you could ditch the outboard MIDI gear entirely.

Re: General thoughts on a native Arduino engine

utz, MIDI shield is just a level translator/optocoupler, it actually works as RS-232 on the Arduino side, all messages decoded in software. The schematics above is pretty much it, sans the buttons and MIDI out (which is just socket and pair of resistors). Actually I have all needed parts (optocoupler is the least common of them, but easily obtainable), so in case I'll need MIDI shield, it is easier to just make one.

PROTODOME, wow, your project sounds really cool, and has a great showcase. You should totally share the stuff on it.


Alright, so I guess we should move into the MIDI-driven synth direction then. I also know there is PC software that can redirect MIDI messages into COM port for Arduino, so no extra hardware is needed. There is also a way to reflash some of Arduino's to appear as a USB MIDI device (like Teensy, but on normal Arduino boards with custom firmware). So we have plently options to do it in hardware. And for software, VSTi Arduino emulator is possible, and can be made eventually, to make things even more accessible, without turning them into something completely virtual.

website - 1bit music - other music - youtube - bandcamp - patreon - twitter (latest news there)

Re: General thoughts on a native Arduino engine

@PROTODOME: very cool project, well done!

it's also possible to build a very simple midi in arduino using this kind of schematics, without optocoupler:

https://github.com/farvardin/C64-music/ … _v2_bb.pdf

(connecting only rxd and gnd) but maybe there are some drawbacks, I don't know.