Microgranny Sampler: Completely Home-built (not a Kit!)

by anyway59 in Circuits > Arduino

3115 Views, 20 Favorites, 0 Comments

Microgranny Sampler: Completely Home-built (not a Kit!)

20221210_114915.jpg

The Bastl Microgranny is a fun and quirky arduino-based granular sampler, ideal for electronic music-making. It's been around in one form or another since around 2014, but you can readily buy the new Monolith design, and the older design, and kits are also still sold. However the code and schematics are in the public domain and open source, so if you are feeling brave you can build one at home without a kit! This is what I have done and am describing in this Instructable. In doing so, I saved some money and learnt quite a lot about how to hack this device.

The build on this page currently describes the basic sampler unit, without the MIDI or the audio recording features. These should not be difficult to add and I may update this page when I have completed those.

Supplies

Arduino UNO (or equivalent e.g. Elegoo UNO R3)

Adafruit Wave Shield Kit (e.g. https://thepihut.com/products/adafruit-wave-shield-for-arduino-kit-v1-1)

SD Card (4GB or smaller recommended) - microSD cards need an adaptor to fit

Shift Register Board

5x10cm Stripboard (or similar size)

2 x 16PIN DIP (DIL) IC Sockets

2 x IC 74HC595 8-Bit Shift Register DIP-16 (e.g. https://www.ebay.co.uk/itm/122154506617?var=422357761378)

2 x 100nF ceramic capacitor (decoupling cap)

1 x 47uF electrolytic capacitor (decoupling cap)


User Interface Board

1 x Stripboard: Suggestion: 8.5x20cm DIY PCB Prototype Printed Circuit Board Stripboard Single Side (e.g. https://www.amazon.co.uk/gp/product/B077HRYNYX/ref=ppx_yo_dt_b_asin_title_o08_s00?ie=UTF8&psc=1)

12 x diode 1N4148 (e.g. https://www.ebay.co.uk/itm/232250227613)

16 x 1K 1/4W Metal Film Resistors 

3 x 10K 1/4W Metal Film Resistors 

1 x Red 7 Segment 0.56" LED Display Common Anode (e.g. https://www.ebay.co.uk/itm/275205669650?var=575479300926)

1 x Tricolour RGB 5mm Clear LED 4 pin Common Anode (e.g. https://www.ebay.co.uk/itm/185267879817?var=693035327699)

8 x Lit Push buttons (or use normal push buttons and separate LEDs): Suggestion for light-up buttons: Momentary Tactile Push Button Switch 4 Pin (e.g. https://www.ebay.co.uk/itm/161890441742)

4 x Unlit push buttons: Suggestion for unlit push buttons: 12x12mm Momentary Tactile Push Button Switch PCB Mounted SPST (e.g. https://www.ebay.co.uk/itm/251779585322?var=550703579701)

4 x 100K Linear Potentiometers with Knobs (e.g. https://www.ebay.co.uk/itm/382852312769)

2 x 10K Linear Potentiometers with Knobs

Box and Fixings

Below are all suggestions - of course you might choose / need to use something different

40 Pin 2.54mm Pitch 1X40P Single Row Female Straight Header

Header Pins Strip 0.1" 2.54mm for PCB (e.g.https://www.ebay.co.uk/itm/264445506779?var=564926128422)

Ribbon cable to link Shift-Reg board to UI board: 40 Dupont Jumper Breadboard Cable Lead (e.g. https://www.ebay.co.uk/itm/224448044824?var=523232367498)

1 x Box Suggestion: 90mmx215mmx127mm ABS Shatterproof Black Electronics Project Circuit Box Enclosure With Screws MB4 (e.g. https://www.ebay.co.uk/itm/224467035616?var=523250363065)

M3 Black Nylon Screw Nut Washer 15mm (e.g. https://www.ebay.co.uk/itm/275382260525?var=575820558011)

I used a labelling machine to create the labels for the buttons and pots

Misc

You will need a PC/Laptop with the Arduino IDE for programming the Arduino

Program the Arduino UNO

20221216_114833.jpg

This is a quick and simple procedure, but as it is critical to the end-result, it is probably a good idea to make sure you can do this successfully before buying and building all the other bits and pieces.

The simplest approach (described here) is to program the UNO via the hex file release for Microgranny2.5. This is in the public domain, available here: https://github.com/bastl-instruments/production (filename: microGranny2_5.cpp.hex)

It should allow you to make a device which behaves similarly to a shop-bought MG.

A downside with this method is you can't tweak the code. For that you would need to compile the microgranny source code, which is not super difficult but fiddly enough to warrant a separate Instructable

The following link has a post (dated Wed Aug 24, 2016 7:23 am) describing the software update on a shop-bought MG:

Here we are doing a similar thing but uploading the hex file to our Arduino UNO.

You can find a lot of online and You-Tube tutorials about how to upload a hex file to an Arduino UNO. I prefer the method described below, using the Arduino IDE and modifying the command outputted by the IDE when giving verbose output:

So you need to download the microGranny2_5.cpp.hex and use the method described above to upload it to your UNO.

Buy or Build the Adafruit Wave Shield

20221216_114534.jpg

It turns out that the Microgranny software will work using a standard Adafruit Wave Shield. At the time of writing, this is readily available in kit form for around £25 in the UK. Using this shield simplifies the circuit-building we have to do for this project significantly.

Full build instructions are given here: https://learn.adafruit.com/adafruit-wave-shield-audio-shield-for-arduino

I followed the instructions word-for-word, except for not soldering-in the switched 10K thumbwheel potentiometer. I decided that making the thumbwheel accessible from outside the box was not workable, so connected the switch to the ON position and wired the three potentiometer terminals to a 10K linear pot on the front panel of the box.

Female headers were soldered on the top side of the shield to enable the shift-register board to plug in on top.

Build Shift Register Board

shift_register_board_edit.png
20221216_115250.jpg

For the remaining parts of the build, we need to construct additional circuitry based on the Microgranny schematics, which are available here:

Although it's great to have these schematics, they should be interpreted with care, since I have noticed a few inaccuracies here and there.

The microgranny uses two 74595 shift register ICs to control:

  • 12 LED outputs
  • 1 Tri-colour RGB LED output
  • 1 4-digit 7-segment LED display output
  • 12 push-button inputs

The attached circuit diagram is adapted from the bottomBoard schematic - it is basically just the two 595 shift register ICs with some decoupling capacitors added.

Building the board is relatively easy. I put male headers on the reverse side to plug into the wave shield, and a female header on the top for connecting to the User Interface board.

Be mindful of the positioning of this board in view of how you may eventually fix the UNO in the box later. You can see from the photos what I did.

Having dependable connections between the Shift Register board and the User Interface board is important to end up with a reliable device!

Build User Interface Board

ui_board.png
20221216_115721_edit.jpg
20221216_115743.jpg

This is a rather fiddly and time-consuming exercise with stripboard, due to the many connections involved. Care and patience (which personally I don't always have) are useful here.

In the schematic provided, which was adapted from the official PDFs linked above, the 4 LEDs at the top of the diagram should physically align with the 4 potentiometers, since these LEDs indicate if a pot is 'active' or not. The group of 3 LEDs with 10K resistors is the Tri-colour Common Anode.

Be mindful of the eventual layout and positioning of the buttons, LEDs and display. I did not consider this carefully enough and my display gets in the way of the optimal position of the 'active' LEDs.

You may wish to initially connect a smaller subset of the buttons and LEDs for testing before fully committing (soldering) the whole lot. As a minimum testing configuration you probably need to wire up: HOLD, PAGE, a big button or two, and the pots. You may also need Up and Down to scroll through samples. Next might be to connect the Tri-colour LED and Display to give you confidence things are working.

Test Your Device!

20221216_115410.jpg

If you have followed the steps above and have a programmed UNO, a wave shield connected, the shift register board connected and at least a few buttons and LEDs wired up as per the User Interface schematic, you are close to being able to test something!

The main remaining item (other than headphones and power) is an SD card with suitable samples plugged into the Wave Shield.

The easiest way to achieve that is to download one of the sample banks kindly provided by Bastl here: https://drive.google.com/drive/folders/1x7c-ECKom6FKj2U3h0K5PwwtXZ_Wxodt

The manual: https://bastl-instruments.com/content/files/manual-microgranny-2.pdf has useful information how to format an SD card and how to name your samples to be microgranny-friendly.

I read somewhere that the SD card should not be bigger than 4GB, but I'm not convinced about this being important.

Box and Use Your Device

20221216_115454.jpg
20221216_114439.jpg

When you are sure everything is working, it is time to encase your creation in plastic or your preferred enclosure material to protect your hard work and make it look nicer.

The pots are mounted at the top of the lid, above the User Interface board.

After positioning all buttons and LEDs etc. on the User Interface board, tracing paper was used to create a cardboard template, which was used as a guide to drill holes in the case lid.

The User Interface board is secured to the underside of the lid via nylon screws and nuts.

The 4-digit display is positioned using two 6-pin headers passing through the lid, allowing the display to reside on the front of the case.

The UNO is secured to the side of the case, allowing access to the audio jack of the wave shield, the SD card, and the UNO power and USB. The Wave Shield is plugged into the UNO and the Shift Register plugged into the Wave Shield. Ribbon cable is used to connect the rows (R1-6) and columns (C1-8) to the User Interface board.

The box I chose is huge and wins no prizes for aesthetics, but it represents an example.

Here is a brief video of the working project: https://vimeo.com/781882434


This was an interesting project for me which I hope to expand on with further improvements and hacks.

Have fun :-)