View on GitHub

eBaghet

open source electronic baghet (italian bagpipe) project for Arduino

download .ZIPdownload .TGZ

eBaghet

Open source electronic pipes project for Arduino. Currently include Baghet (italian bagpipes), Great Highland Bagpipes, Small Pipes, Border Pipes, Uillean Pipes, Gaita Gallega and Gaita Asturiana (still in developement).

Largely based on eChanter by Tim Malcolm 2010-2015 CC by-nc-sa. (echanter site, sourceforge repository)

Audio based on the Mozzi Synth libraries and examples Mozzi, Tim Barrass 2012, CC by-nc-sa.

Sound for the Baghet is provided by Valter Biella

Build instruction:

For now, follow the excellent guide at echanter site.

To program the Arduino:

Download and install the Arduino IDE (tested on version 1.8.3)

Download and install my forked version of the Mozzi library from this site

Additional step for STM32F1 (Blue Pill)

The eBaghet source is compatible and tested with Blue Pill (STM32F1).

To install and make STM32F1 work, follow the tutorial by Luca Dentella.

Then download the Arduino_STM32 repository from Roger Clark Melbourne site, unzip somewhere, rename the Arduino_STM32-master folder to Arduino_STM32 and move it to C:/Program Files (x86)/Arduino/hardware.

If you want to use MPR12, download and install my library from this site

Configuration

Open the Mozzi config file [Arduino dir]/libraries/Mozzi/mozzi_config.h. If you’re using HIFI mode, find the line that says AUDIO_MODE and make sure the section of code looks like this:

      //#define AUDIO_MODE STANDARD
      //#define AUDIO_MODE STANDARD_PLUS
      #define AUDIO_MODE HIFI

Scroll down to AUDIO_RATE and make sure the section of code looks like this

      //#define AUDIO_RATE 16384
      #define AUDIO_RATE 32768

If you don’t want to use HIFI mode, you can activate stereo hack, to have drone sound on a channel and the chanter on another one, like this:

	  #define STEREO_HACK true

Save mozzi_config.h.

Start the Arduino IDE.

Open the eBaghet sketch from wherever it was unzipped (eBaghet.ino is the main sketch).

At this point there are a few things that can be changed in the config file. To edit the file click on the ‘eBaghet_config’ file tab in the Arduino IDE.

You can use high resolution samples by defining:

  #define USE_16BIT_SAMPLES true

You can define order with which instruments are presented:

  #define STARTING_INSTRUMENT	GHB
  #define FIRST_INSTRUMENT	BGT
  #define SECOND_INSTRUMENT	BRD
  #define THIRD_INSTRUMENT	SML
  #define FOURTH_INSTRUMENT	UIL

GHB is Great Highland Bagpipes, BGT is Baghet, BRD is border pipes, SML is small pipes, UIL is Uilleann pipes, GAL is Gaita gallega, AST is Gaita asturiana.

You can define if by default the chanter starts with a drone sound:

  #define STARTING_DRONES	DRONE_ON

or not, modifying the line above to:

  #define STARTING_DRONES	DRONE_OFF

and you can chose the starting intonation of the drones for the Baghet:

  #define STARTING_DRONE_INT	DRONE_INT_STANDARD

If you leave DRONE_INT_STANDARD, the Baget starts with a G drone. If you substitute with DRONE_INT_A, it starts with an A drone, and if you substitute with DRONE_INT_C, it starts with a C drone.

Then you can chose which style of sensors you are using for the fingering:

  #define TOUCHMODE TOUCH_CAP

With TOUCH_CAP, you use captouch sensor, with TOUCH_SWITCH standard pushbuttons and with TOUCH_MP121 the MP121 breakout board by Adafruit.

NOTE: MP121 is not working with STM32 right now and I have tested just a little with Arduino Nano, so it is totally experimental.

If you did use captouch style sensors, then at some point you may want to change the 4 on this line

  #define CAPTOUCH_TRIGGER 4

to something a little higher or lower, depending on how the finger detection works for you. For me, 4 is a good trigger level, but 6 also works OK.

You can also decide relative volumes for drones and chanter for all instruments, modifying these lines:

  #define GHB_CHANTER_VOLUME	8
  #define GHB_DRONES_VOLUME	4
  
  #define BGT_CHANTER_VOLUME	8
  #define BGT_DRONES_VOLUME	4
  
  #define BRD_CHANTER_VOLUME	8
  #define BRD_DRONES_VOLUME	8
  
  #define SML_CHANTER_VOLUME	8
  #define SML_DRONES_VOLUME	8
  
  #define UIL_CHANTER_VOLUME	8
  #define UIL_DRONES_VOLUME	8

  #define GAL_CHANTER_VOLUME	8
  #define GAL_DRONES_VOLUME	8
  
  #define AST_CHANTER_VOLUME	8
  #define AST_DRONES_VOLUME	8

You can change the numbers to any value between 1 and 8 (1 is minimum volume, 8 is maximum volume).

Last thing you can change are the pins where the eight finger sensors are connected. There is one line for STM32 and one for other Arduino boards:

  #if IS_STM32()
  int sensor_pins[] = {PA7, PA6, PA5, PA4, PA3, PA2, PA1, PA0};
  #else
  int sensor_pins[] = { 12, 8, 7, 6, 5, 4, 3, 2 };
  #endif

They are ordered from high A (12 and PA7) to low A (2 and PA0).

Programming

Options

The eBaghet has several working mode depending on which keys you close when you turn on the chanter power:

Fingering

Great Highland Bagpipes, border pipes and small pipes follow this finger chart:

GHB

For Uilleann Pipes follow this finger chart:

UIL

For the Baghet, follow this finger chart (According to Manuale del Baghet by Valter Biella):

Baghet

Dashed keys can be closed or open as comfort of position needs.