Category Archives: Music

Moving photo test

Using a bowden tube (PTFE tube 1mm) with a 3d printed holder.
(ptfe is very smooth)

This is a test setup.
I’ve removed arms and the flute on the bottom picture using AI.
Then printed backpicture and top on sticky paper and stuck it on sturdy heavy paper.

I want to make a moving picture which moves our band members when there is sound (music).
(Guitar, Harp, Bagpipes and Flute)

First test

Cheapest electronic bagpipe chanter in 6 hours.

My proof of concept to build an electronic chanter for less than 4 euros.

It uses a Lolin32 Lite and a buzzer. (No libraries needed)
(Some wires, thumbtacks and a PVC tube.)

I still have to glue the thumbtacks

Plays accidentals (false fingering)
Vibrato
Has serial console debugging
Need other frequencies? Just edit the source.

CODE

int prevnote = 0;

// Note freq table
int ha = 880;
int hg = 783;
int fs = 739;
int f = 698;
int e = 659;
int d = 587;
int cs = 554;
int c = 523;
int b = 493;
int as = 466;
int la = 440;
int lg = 391;
int mute = 0;

// 8 Bits to note, luckly not 9 fingers :)
// 0 (00000000) = all fingers off = mute
// bottom hand top hand
//     0111 011
//             1
// 01110111 = 119 = E
// 255 (11111111) = all fingers on = lg
// below per 10 all 255 posibilities
// Look at position 175
// custom frequency to get vibrato on D 
// using bottom hand middle finger.

int data[] = { 
mute,hg,ha,fs,ha,hg,ha,e,ha,hg,ha,
f,ha,hg,ha,d,ha,hg,ha,fs,ha,
hg,ha,e,ha,hg,ha,f,ha,hg,ha,
c,ha,hg,ha,f,ha,hg,ha,e,ha,
hg,ha,f,ha,hg,ha,d,ha,hg,ha,
f,ha,hg,ha,e,ha,hg,ha,f,ha,
hg,ha,b,ha,hg,ha,f,ha,hg,ha,
e,ha,hg,ha,f,ha,hg,ha,d,ha,
hg,ha,f,ha,hg,ha,e,ha,hg,ha,
e,ha,hg,ha,c,ha,hg,ha,f,ha,
hg,ha,e,ha,hg,ha,f,ha,hg,ha,
d,ha,hg,ha,fs,ha,hg,ha,e,ha,
hg,ha,f,ha,hg,ha,la,ha,hg,ha,
f,ha,hg,ha,e,ha,hg,ha,f,ha,
hg,ha,d,ha,hg,ha,f,ha,hg,ha,
e,ha,hg,ha,f,ha,hg,ha,cs,ha,
hg,ha,f,ha,hg,ha,e,ha,hg,ha,
f,ha,hg,ha,580,ha,hg,ha,f,ha,
hg,ha,e,ha,hg,ha,f,ha,hg,ha,
as,ha,hg,ha,f,ha,hg,ha,e,ha,
hg,ha,f,ha,hg,ha,d,ha,hg,ha,
f,ha,hg,ha,e,ha,hg,ha,f,ha,
hg,ha,c,ha,hg,ha,fs,ha,hg,ha,
e,ha,hg,ha,f,ha,hg,ha,d,ha,
hg,ha,fs,ha,hg,ha,e,ha,hg,ha,
fs,ha,hg,ha,lg };

void setup() {
  pinMode(14, OUTPUT);

  Serial.begin(115200);
  delay(1000); 
  }

void loop() {
  int t1=touchRead(4);  
  int t2=touchRead(2);
  int t3=touchRead(15);
  int t4=touchRead(13);
  int t5=touchRead(12);
  int t6=touchRead(27);
  int t7=touchRead(33);
  int t8=touchRead(32);
  
int note = 0;

// Debug reading  
//Serial.println(t1);
// My readings are near zero and above 50
// So I chose 30 (adjust when needed)

if ( t1 < 30) {
  bitSet(note, 0);  
} 
if ( t2 < 30) {
  bitSet(note, 1);  
} 
if ( t3 < 30) {
  bitSet(note, 2);  
} 
if ( t4 < 30) {
  bitSet(note, 3);  
} 
if ( t5 < 30) {
  bitSet(note, 4);  
} 
if ( t6 < 30) {
  bitSet(note, 5);  
} 
if ( t7 < 30) {
  bitSet(note, 6);  
} 
if ( t8 < 30) {
  bitSet(note, 7);  
}

//Serial.println(note);
  if (note == 0 && note != prevnote) {
    noTone(14);
    prevnote = 0;
  }

if (note != prevnote) {
  tone(14,data[note]);
  // debug
  //Serial.print("Note number : ");
  //Serial.println(note);
  //Serial.print("Freq : ");
  //Serial.println(data[note]);
  
  prevnote = note;
  }
}

Pipe tunes

I Still got 19 posts in draft, I know, but I saw a post on Reddit about tunes being played.

(Only pipe tunes) Only the lists I could find, so incomplete. (No tunes in this list from 2022-now)
Some I’ve played for 30+ years, others only a while.

I’m going to rate these soon

1st pipeband – started here at 14 yrs
2nd pipeband – continental grade 2 band
3rd pipeband – 4th grade, teaching
4th pipeband – 4th grade, teaching and piper for the Highland Dancers

A lot of tunes are being played in all bands

Own compositions are on another page

1st Pipeband

  • 1976 Police Tattoo 1st and 2nd
  • 42nd Highlanders
  • 51st highland division, The
  • Ale is dear, The
  • Amazing Grace + Marching arrangement
  • Arrival
  • Aspen bank
  • Atholl highlanders
  • Auld lang Syne 1st & 2nd
  • Balmoral 1st and 2nd
  • Banks of the Lossie, The
  • Battle of Killiecrankie
  • Battle of the Somme, The
  • Bloody fields of flanders, The
  • Bonnie Charlie is noo awa’
  • Bonnie Galloway
  • Bonnie lass O’fyvie
  • Brown haired Maiden, The
  • Bugle Horn
  • Cabar Feidh
  • Caller herrin
  • Castle Dangerous 1st & 2nd
  • Cock o’ the north
  • Corriechollie
  • Cradle song, The
  • Crusaders March, The
  • Cullen bay (Slow,Quick & 2nd)
  • Desert Storm
  • Dovecote Park
  • Dream valley of Glendaruel
  • Earl of Mansfield, The
  • Farewell to Nigg
  • Flett from flotta
  • Flower of Scotland, The 1st &
  • Glendaruel highlanders, The
  • Going Home
  • Green hills of Tyrol, The
  • Greenwood side
  • Heights of dargai, The
  • Highland cathedral 1st & 2nd
  • Highland laddie
  • High road to Gareloch, The
  • Hills of alva, The
  • Itchy Fingers
  • Jimmy Findlater
  • Killworth hills
  • Kyle Sku 1st & 2nd
  • Lady Mackenzie of Fairburn
  • Lochanside
  • Loch Duich
  • Loch Rannoch 1st & 2nd
  • Marie’s wedding
  • Meeting of the waters, The
  • Miss Girdle
  • MRS. Flora Duncan
  • Murdo’s wedding
  • My Home
  • My lodging’s on the cold groun
  • Old rustic bridge, The
  • Paddy’s leather breeches
  • Piobaireachd of Donald Dubh
  • Pipe Dreams
  • Pipers prayer, The
  • P/M J.K. Cairns 1st,2nd
  • P/M Robert Martin
  • Pony Galop
  • Road to the Isles
  • Rose of Allandale
  • Rowan Tree, The
  • Salute to the Chieftain
  • Scotland the brave
  • Scots Royal
  • Skye boat song
  • Sweet maid of Glendaruel, The
  • Swinging highland safari
  • Teribus
  • Trumpet Voluntary
  • wee highland laddie, The
  • When the battle is over
  • Wings
  • Within a mile o’ Edinburgh toon

2nd pipe band

  • Brown haired Maid
  • Susan MacLeod
  • Donald MacLeans Farewell to Oban
  • Major David Manson
  • Maggie Cameron
  • Carradale Bay
  • The Final Fling
  • Eirnies Impact
  • Bells of Dunblane
  • Finbar Sauders
  • Grey old lady of Raasay
  • Jimmy Rollo
  • Miss drummond of Perth
  • Black watch polka
  • Megalomania
  • Shovel Tongue
  • Devil in the Kitchen
  • Hellbound Train
  • Murrays Fancy
  • Bulgarian Bandit
  • Amazing Grace
  • Highland Cathedral
  • Penny Cross cottage
  • Blustering Home
  • Cutting Bracken
  • Cullen Bay
  • Eileen MacDonald
  • Whitby Runaround
  • Troys Wedding
  • Bumpy old road
  • Desert Storm
  • Daryl Boyle
  • Drochaid Luidaid
  • Easy club reel
  • Itchy Fingers
  • Stornoway
  • Up to the line
  • Brig Snow
  • Kitty lie over
  • Angus McKinnon
  • General Montgomerey
  • Dr Ross Welcome
  • Cabar Feidh
  • Accordion Man
  • Wings
  • Lord Lovats Lament
  • 1976 Police Tattoo
  • Rowan Tree
  • Crusaders March
  • Scotland the Brave
  • Lochanside
  • Balmoral
  • PM JK Cairns
  • Collins Cattle
  • When the battle is over
  • Green hills of Tyrol
  • Brown Haired maiden
  • Highroad to Gairloch
  • Highland Laddie
  • Makays Farewell
  • Johnny Cope

3rd pipe band

  • Skye boat song
  • Brown haired maiden
  • Highland Cathedral
  • Highroad to Gareloch
  • Loudons wood and braes
  • Tail Toddle
  • Stumpie
  • Highroad to Linton
  • Hills of Caithness
  • The steamboat
  • Kenmure Lads
  • Morag of Dunvegan
  • Badge of Scotland
  • Lord Lovats Lament
  • Glendaruel Highlanders
  • 48th Highlanders of Canada
  • Highland Laddie
  • Colonel Robertson
  • Green Hills of Tyrol
  • When the battle is over
  • Lochanside
  • Magersfontein
  • Scots wha hae
  • March for Gerrit Ham
  • Flower of Scotland
  • Amazing Grace
  • Wings
  • Barren rocks of Aden
  • Wilhelmus
  • Flowers of the Forrest
  • Lochaber no more
  • Morag of Dunvegan

4th pipe band

  • Argyll Broadswords Set (Piper for the dancers)
  • Flora MacDonalds Fancy Set (Piper for the dancers)
  • Scottish Lilt (Piper for the dancers)
  • Seann Truibhas (Piper for the dancers)
  • Highland Fling Set (Piper for the dancers)
  • Sword dance (Piper for the dancers)
  • Accordeon Man
  • Amazing Grace
  • Auld Lang Syne
  • Battle of the Somme
  • Bonnie Dundee
  • Bonnie Lass o’ Fyvie
  • Brown Haired Maiden
  • Cock ‘o the North
  • Coline`s Persuasion
  • Conquest of Paradise
  • Cullen Bay
  • Dark Island
  • Farewell to Camraw
  • Flower of Scotland
  • Glasgow City Police Pipers
  • Glendaruel Highlanders
  • Going Home
  • Green hills of Tyrol, The
  • Highland Cathedral
  • Highland Laddie
  • Highroad to Gairloch
  • Itchy Fingers
  • Killworth Hills
  • Loch Lomond
  • Millenium Prayer for Peace
  • Mrs Flora Duncan
  • Mull of Kintyre
  • Murdos Wedding
  • My Home
  • Old Rustic Bridge
  • Rose of Allandale
  • Rowan Tree, The
  • Scotland the Brave
  • Skye Boat Song
  • Swinging Highland Safari
  • Teribus
  • When the Battle is Over
  • Wings
  • Within a Mile o’ Edinburgh Toon

Tapsalteerie folkband

  • Ass in the Graveyard
  • Sandy’s new Chanter
  • Boys of Brittany
  • Flower of Scotland
  • Death of a Spacepiper
  • Irish Washerwomen
  • Pumkin’s Fancy, The
  • Paddy’s Leather Breeches
  • Itchy Fingers
  • Ebb Tide
  • Atholl Highlanders
  • Jolly Beggarman
  • Roses o’ Prince Charlie, The
  • Song for a smallpipe
  • Brest St. Marc
  • Blackbird
  • Masons Apron
  • The Haunting

Nae Bother Folkband

  • Bulgarian Red
  • Busindre Reel
  • Cairn Water
  • Caledonia
  • Engine Room
  • Farewell to Uist / The Lochaber Badger
  • Hector the Hero
  • Hoolit / Electric Chopsticks
  • King’s Shilling / Highland Laddie
  • Maggie West’s Waltz
  • Morag’s Jig / Joe Wilson / Cork Hill
  • Morrison’s Jig / Drowsy Maggie
  • Passing Places / Road East / Didi’s Tune
  • Pumpkin’s Fancy / The High Drive
  • Trip to Ireland / Jutland
  • Waterbound
  • Journey to the Centre of the Celts
  • Return from Finegal / Chanter’s Song
  • The butterfly / Lochaber Dance
  • Breizh / Seagull
  • Terrortime
  • Sir john Fenwick (/ Sir Sidney Smit)
  • Turning Away (zang)
  • Devil in the Kitchen / Andy Renwicks Favourite Ferret

Own repetoire

  • Archie Beag
  • Arthur Gillies
  • Ballachullish Walkabout, The
  • Banjo Breakdown, The
  • Blackbird, The
  • Brest st. Marc
  • Bronni’s Blue Brozzi
  • Bulgarian Bandit, The
  • By the river Aoro
  • Cabar Feidth
  • Calypso Piper
  • Circassian Circle, The
  • Clan Campbell’s Gathering
  • Classical Bob
  • Clumsy Lover, The
  • Cork Hill
  • Crossing the Minch
  • Da Hee and Do
  • Dark Island, The
  • Dessert Storm
  • Donella Beaton
  • Finlay M MacRae
  • Flying Haggis
  • Gaelforce Wind
  • Galician Dance
  • Galician Jig
  • Geese in the Bog
  • Glasgow City Police Pipers
  • Hag at the Churn, The
  • Haunting, The
  • Hen and the Turkey, The
  • Isabelle Blackley
  • Jiggernaut, The
  • Kelsey’s Wee Reel
  • Kitty lie over
  • Lieut McGuire’s Jig
  • Magpie, The
  • Mason’s Apron, The
  • Megalomania
  • Miss Popple’s Reel
  • Moving Cloud
  • Not the Bunny Hop
  • Paddy o’ Rafferty
  • Pipe Major Joe Wilson
  • Pipe Major’s Nightmare, The
  • Pony Galop
  • Raigmore
  • Richard’s gone bananas
  • Road North, The Air
  • Sands of Kuwait March
  • Skylark’s Ascension, The
  • South Uist Hornpipe, The
  • Swinging Highland Safari
  • Steam Train to Mallaig
  • Steampacket, The
  • Train Journey North, The
  • Whitby Runaround, The
  • Wise Maid, The
  • Abdul’s
  • Alastair’s Vintage Bar
  • A mans a man Nae Bother Version
  • An Drochaid Chluiteach
  • Andy Renwick’s Favourite Ferret
  • Angus Stewart
  • Ass in the Graveyard
  • Bells of Dunblane
  • Bonnie Portmore
  • Bonnie Portmore zang versie
  • Brenda Stubbert
  • Bugle Horn
  • Bulgarian Red
  • Busindre Reel
  • Caledonia Nae Bother Version
  • Calypso Piper
  • Calypso Piper – Second
  • Captain Colin Campbell
  • Celtic Bolero
  • Celtic Bolero – Seconds
  • Clumsy Lover (hornpipe)
  • Clumsy Lover (jig)
  • Corkhill
  • Cullen Anderson
  • Da Hee and Do (with seconds)
  • Dinkies
  • Dirty Bee
  • Donald MacLean’s Farewell To Oban
  • Dreams of a Child
  • Ducking and Diving
  • Ebb Tide
  • Electric Chopsticks
  • E Minor End Theme
  • Engine Room
  • Frances Morton’s
  • Glasgow City Police Pipers
  • Hector the Hero
  • Hellbound train
  • Hornpipe, Afternoon at the Green Monster
  • Il Paco Grande
  • In The Kitchen
  • Itchy Fingers (8 parts)
  • Jock Broon’s 70th
  • Kirstie MacCallman’s Favourite
  • La Serenissima
  • Last Word
  • Masons Apron
  • Masons Apron – cont
  • Mhair Bhan Og (Fair Young Mary)
  • Mhair Bhan Og (Fair Young Mary) – Harmony
  • Michael Faughman’s Air
  • Mozart on the Rampage
  • Music for a found harmonium
  • On the Mash
  • An Drochaid Chluiteach
  • PM Joe Wilson
  • PM John D Burgess
  • Pony Galop
  • Pressed_For_Time
  • Richard’s gone Bananas
  • Rob’s Request
  • Rory MacLeod
  • Ruby Grant
  • Senor Celtic y el Grupo
  • SleepingTune
  • Smenco Horo
  • Song for the Smallpipe
  • Sound Of Sleat
  • Steamtrain to Mallaig
  • Terror Time
  • The Bumpy Road
  • The Countryside Ceilidh
  • The Dangling Drummer
  • The Fleshmarket Close
  • The Fourth Floor
  • The High Drive
  • The Hoolit
  • The Imps
  • The January Girl
  • The King Danced at Dawn
  • The Korgi
  • The Little Cascade
  • The Maid Behind The Bar
  • The Pumpkin’s Fancy
  • The Tourist
  • The Unrest
  • TNT
  • Top Deck in Perth
  • Touchin’ Cloth
  • We will rock you
  • Zito the bubbleman

Dance Tunes

  • Devil in the Kitchen
  • Orange and Blue
  • Ghillie Calum Strathspey
  • Ghillie Calum Reel
  • Rose among the Heather
  • Piper of Drummond
  • Three Girls of Portree
  • Battle of the Somme, The
  • Flora macdonalds fancy

Weekend work

Weekend of music, BBQ, designing and more.

I was making a re-arrangement of a bagpipe tune. Designing a blender 3D printed light box. Cooking a Mexican BBQ dinner. Visiting a textile place with old and new weaving looms. (Which gave me some great ideas). And working on my 68000 computer.

A great weekend.

No embellishments yet, and no lights in de blender logo.

My little record player project is also in the picture, I need to re-print the parts using my new printer!

LMS Record player V.something .. final? No

But it works! Many iterations .. almost perfect

Recordplayer model by kriswillcode, but heavily remixed

Record player is going to be re-printed at a higher quality.

  • Put a printed image on the player, and it plays the album
  • Move the arm, and the next track will be played
  • Press upper white button, and the music will pause/resume
  • Press lower button … ??? Don’t know yet

Updated python client (see previous posts)

import paho.mqtt.client as mqtt
import urllib.request
from time import sleep

def on_connect(client, userdata, flags, rc):  # The callback for when the client connects to the broker 
        print("Connected with result code {0}".format(str(rc)))  
        client.subscribe("spotify/rfid/idlms")  
        client.subscribe("spotify/rfid/but1")  
        client.subscribe("spotify/rfid/but2")  
        client.subscribe("spotify/rfid/arm")  

def on_message(client, userdata, msg):  # The callback for when a PUBLISH message is received from the server. 
        print("Message received-> " + msg.topic + " " + str(msg.payload))  # Print a received msg
        if msg.topic == "spotify/rfid/idlms":
            urllib.request.urlopen("http://LMS-SERVER-IP:9000/anyurl?p0=playlistcontrol&p1=album_id:" + msg.payload.decode() + "&p2=cmd:load&player=00:04:20:16:d9:04")
        if msg.topic == "spotify/rfid/but1":
            urllib.request.urlopen("http://LMS-SERVER-IP:9000/anyurl?p0=pause&player=00:04:20:16:d9:04")
            sleep(1)
        if msg.topic == "spotify/rfid/but2":
            urllib.request.urlopen("http://LMS-SERVER-IP:9000/anyurl?p0=pause&pt=1&player=00:04:20:16:d9:04")
            sleep(1)
        if msg.topic == "spotify/rfid/arm":
            urllib.request.urlopen("http://LMS-SERVER-IP:9000/status.html?p0=button&p1=jump_fwd&player=00:04:20:16:d9:04")
            sleep(1)

client = mqtt.Client("lmsclient")  # Create instance of client with client ID “digi_mqtt_test”
client.on_connect = on_connect  # Define callback function for successful connection
client.on_message = on_message  # Define callback function for receipt of a message
client.connect('MQTTSERVER', 1883)
client.loop_forever()  # Start daemon

Wemos INO file

#include <Arduino.h>
#include <SPI.h>
#include <MFRC522.h>
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <PubSubClient.h>
#define SS_PIN 15
#define RST_PIN 0

const int buttonPin1 = D1;  
const int buttonPin2 = D2;   

int buttonState1 = 0; 
int buttonState2 = 0; 

MFRC522 mfrc522(SS_PIN, RST_PIN);
  MFRC522::StatusCode status; //variable to get card status
  
  byte buffer[18];  //data transfer buffer (16+2 bytes data+CRC)
  byte size = sizeof(buffer);

  uint8_t pageAddr = 0x06;  //In this example we will write/read 16 bytes (page 6,7,8 and 9).
                            //Ultraligth mem = 16 pages. 4 bytes per page.  
                            //Pages 0 to 4 are for special functions.           
  
unsigned long cardId = 0;
WiFiClient net;
PubSubClient client(net);
const char* mqtt_server = "MQTTBROKER";
const char* ssid = "MYSSID";
const char* password = "MYWIFIPASWORD";
String topicStr = "";
byte buffer2[8];

boolean Rflag=false;
int r_len;
char payload[5];
byte value[5];
void setup() {
  Serial.begin(9600);
    pinMode(buttonPin1, INPUT_PULLUP);
    pinMode(buttonPin2, INPUT_PULLUP  );

  SPI.begin();
  mfrc522.PCD_Init();
  WiFi.mode(WIFI_AP_STA);
  WiFi.begin(ssid, password);
  client.setServer(mqtt_server, 1883);
     delay(100);
    client.setCallback(callback);
      delay(100);
    client.subscribe("spotify/rfid/in/#");
}
void reconnect() {
  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
  }
  while (!client.connected()) {
    String clientId = "rfid-";
    clientId += String(random(0xffff), HEX);
    if (!client.connect(clientId.c_str(), "rfidclient", "...")) {
      delay(5000);
    }
  }
  client.subscribe("spotify/rfid/in/#");
}
void callback(char* topic, byte* payload, unsigned int length) {
  Serial.print(F("Called"));
   Rflag=true; //will use in main loop
   r_len=length; //will use in main loop
   int j=0;
     for (j;j<length;j++) {
       buffer2[j]=payload[j];
       //Serial.print((char)payload[j]);
       }
if (r_len < 3) {
  Rflag=false;
  Serial.print(F("Set false"));
}
buffer2[j]='\0'; //terminate string
}

void loop() {
    if (!client.connected()) {
    reconnect();
  }

buttonState1 = digitalRead(buttonPin1);
  //Serial.print(buttonState1);
  if (buttonState1 == 0 ) {
    client.publish("spotify/rfid/but1", "0");
  }
buttonState2 = digitalRead(buttonPin2);
  //Serial.println(buttonState2);
  if (buttonState2 == 0 ) {
    client.publish("spotify/rfid/but2", "0");
  }

int reading = analogRead(0);
  //Serial.println(reading);
  if (reading > 500 ) {
    client.publish("spotify/rfid/arm", "0");
  }
  
  client.loop();
  if (!mfrc522.PICC_IsNewCardPresent()) {
    return;
  }
  if (!mfrc522.PICC_ReadCardSerial()) {
    return;
  }
if (Rflag) {
        for (int i=0; i < 4; i++) {
    //data is writen in blocks of 4 bytes (4 bytes per page)
    status = (MFRC522::StatusCode) mfrc522.MIFARE_Ultralight_Write(pageAddr+i, &buffer2[i*4], 4);
    if (status != MFRC522::STATUS_OK) {
      return;
    }
    
  }
  Rflag=false;
}

  cardId = getCardId();
  char buffer3[10];
  sprintf(buffer3, "%lu", cardId);
  client.publish("spotify/rfid/id", buffer3);

  status = (MFRC522::StatusCode) mfrc522.MIFARE_Read(pageAddr, buffer, &size);
  if (status != MFRC522::STATUS_OK) {
    Serial.println(F("MIFARE_Read() failed: (R)"));
    Serial.println(mfrc522.GetStatusCodeName(status));
    return;
  }

  Serial.println(F("Read data: "));
  for (byte i = 0; i < 5; i++) {
    Serial.write(buffer[i]);
       buffer2[i]=buffer[i];
    }
       
  client.publish("spotify/rfid/idlms", buffer,5);
  delay(1000);
  mfrc522.PICC_HaltA();
}

unsigned long getCardId() {
  byte readCard[4];
  for (int i = 0; i < 4; i++) {
    readCard[i] = mfrc522.uid.uidByte[i];
  }
  return (unsigned long)readCard[0] << 24
    | (unsigned long)readCard[1] << 16
    | (unsigned long)readCard[2] << 8
    | (unsigned long)readCard[3];
}

Listening to Paganini

Niccolò (or Nicolò) Paganini.
October 1782 – 27 May 1840) was an Italian violinist and composer. He was the most celebrated violin virtuoso of his time, and left his mark as one of the pillars of modern violin technique. His 24 Caprices for Solo Violin Op. 1 are among the best known of his compositions and have served as an inspiration for many prominent composers.

I love listening to Paganini. The man was a beast.
Extreme technical, a pop star in his time.
But also because of that, he was seen as a demon.

Like the master bagpipers Stuart Liddell or the late Gordon Duncan.

Listening to Paganini’s caprices was wonderful.

A capriccio or caprice (sometimes plural: caprices, capri or, in Italian, capricci), is a piece of music, usually fairly free in form and of a lively character. The typical capriccio is one that is fast, intense, and often virtuosic in nature.

My top selection :

1,4,5,3

Why difficult?

Because of the advanced techniques, including parallel octaves, rapid interval shifts, extremely fast scales and arpeggios (including minor scales), left-hand pizzicato, high positions, and fast string crossings. Additionally, it features many double stops, such as thirds and tenths.

An arpeggio is a type of broken chord in which the notes that compose a chord are individually sounded in a progressive rising or descending order.

Pizzicato is a playing technique that involves plucking the strings of a string instrument.

Double stops are a fundamental technique in which two notes are played simultaneously on a stringed instrument. In the context of the violin, this entails using the bow to sound two adjacent strings at the same time.

On another note:

I finally got hold of the last missing Audio CD from Martyn Bennett!
I was looking for this for ages!

New POC / WIP Rfid Read/Write

yes, again. Another change.

UPDATE: Working example at bottom!

Micros*ft Surface Running Linux!

I don’t want IDs and Paths in a Home Assistant automation.
The RFIDs can store more than enough data to store the paths to albums.

I Also tested with ESPHOME in HA, but you can’t write tags.

ESPHOME Config for my RFID device (NOT USED ANYMORE)

esphome:
  name: rfidtag
  friendly_name: rfidtag

esp8266:
  board: d1_mini

mqtt:
  broker: IPMQTTBROKER

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "xxxxxxxxxxxxxxxxxx="

ota:
  password: "xxxxxxxxxxxxxxxxxxxxx"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Rfidtag Fallback Hotspot"
    password: "xxxxxxxxxxxxxx"

captive_portal:
    
spi:
  clk_pin: D5
  miso_pin: D6
  mosi_pin: D7
rc522_spi:
  cs_pin: D8
  update_interval: 1s
  on_tag:
    then:
      - mqtt.publish:
          topic: rc522/tag
          payload: !lambda 'return x;'
  on_tag_removed:
    then:
      - mqtt.publish:
          topic: rc522/tag_removed
          payload: !lambda 'return x;'

The next iteration of my Rfid controller will have a write function for the RFID tags.

  1. Stick a tag on a cover art piece of cardboard. (see below)
  2. Read path from data sector.
    • Send path to player automation
  3. Send path to program using MQTT or website if needed.

Not sure yet, also want to implement a wifi manager on the wemos.

Changes on above idea:

  • Paths are too long, I could not work out how to create a working program using this.
  • I stopped using paths, instead I’m using the Logitech media server album IDs.
  • Using two python scripts, I can use one for programming the card, and another script to control LMS.

How does it work

RFid device is connected to the network.

Start query.py on your LMS server.
Search for an album name, it will present an ID and Album name in a list.
Enter the ID you want to program, or 0 to exit.
(This will also reset the programming mode)

Place an empty or previously programmed tag on the device.
It will write the album ID on the tag.

Then it will start the album.
Changing the tags will also just change the album playing.

(NOTE: My genre spotify player still works using this method, using the same device)

A second python script will read the Mqtt topic and control the Squeezebox player.

Python Code DB Query

import sqlite3
#paho-mqtt
import paho.mqtt.publish as publish

host = "IPMQTTBROKER"
port = 1883
topic = "spotify/rfid/in/write"
auth = {'username': 'xxxx','password': 'xxxxx'}
client_id = "spotithing"

def readSqliteTable(albumname):
    try:
        sqliteConnection = sqlite3.connect('/var/lib/squeezeboxserver/cache/library.db')
        cursor = sqliteConnection.cursor()
        albumname = "%" + albumname + "%"
        cursor.execute("select * from albums where title Like ?",
               (albumname,))
        records = cursor.fetchall()
        for row in records:
            print("Id: ", row[0],row[1])
        cursor.close()

    except sqlite3.Error as error:
        print("Failed to read data from sqlite table", error)
    finally:
        if sqliteConnection:
            sqliteConnection.close()

album = input("Album name ? ")
readSqliteTable(album)

number = input("Enter ID or 0 to quit : ")
publish.single(topic, "00000" , qos=1, hostname=host, port=port,
        auth=auth, client_id=client_id)
if number == 0:
        exit()
publish.single(topic, number, qos=1, hostname=host, port=port,
        auth=auth, client_id=client_id)
print("Program your tag")
print("Reset/disable writing using exit with 0!")

Python Code Controller (this one needs to be running at all times)

import paho.mqtt.client as mqtt
import urllib.request

def on_connect(client, userdata, flags, rc):  
        print("Connected with result code {0}".format(str(rc)))
        client.subscribe("spotify/rfid/idlms")

def on_message(client, userdata, msg):
        print("Message received-> " + msg.topic + " " + str(msg.payload))  # Print a received msg
        urllib.request.urlopen("http://IPADDRESLMS:9000/anyurl?p0=playlistcontrol&p1=album_id:" + msg.payload.decode() + "&p2=cmd:load&player=b8:27:eb:11:16:ab")
#NOTE also change b8:27:eb:11:16:ab into you players MACAddress!

client = mqtt.Client("digi_mqtt_test")  
client.on_connect = on_connect  
client.on_message = on_message  
client.connect('IPMQTTBROKER', 1883)
client.loop_forever()  

Arduino Code (see schematic in other post)

#include <Arduino.h>
#include <SPI.h>
#include <MFRC522.h>
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <PubSubClient.h>
#define SS_PIN 15
#define RST_PIN 0
MFRC522 mfrc522(SS_PIN, RST_PIN);
  MFRC522::StatusCode status; //variable to get card status
  byte buffer[18];  //data transfer buffer (16+2 bytes data+CRC)
  byte size = sizeof(buffer);
  uint8_t pageAddr = 0x06;  //In this example we will write/read 16 bytes (page 6,7,8 and 9).
                            //Ultraligth mem = 16 pages. 4 bytes per page.  
                            //Pages 0 to 4 are for special functions.           
unsigned long cardId = 0;
WiFiClient net;
PubSubClient client(net);
const char* mqtt_server = "IPMQTTBROKER";
const char* ssid = "MYSSID";
const char* password = "MYSSIDPASS";
String topicStr = "";
byte buffer2[8];

boolean Rflag=false;
int r_len;
char payload[5];
byte value[5];
void setup() {
  Serial.begin(9600);
  SPI.begin();
  mfrc522.PCD_Init();
  WiFi.mode(WIFI_AP_STA);
  WiFi.begin(ssid, password);
  client.setServer(mqtt_server, 1883);
     delay(100);
    client.setCallback(callback);
      delay(100);
    client.subscribe("spotify/rfid/in/#");
}
void reconnect() {
  while (WiFi.waitForConnectResult() != WL_CONNECTED) {
  }
  while (!client.connected()) {
    String clientId = "rfid-";
    clientId += String(random(0xffff), HEX);
    if (!client.connect(clientId.c_str(), "rfidclient", "...")) {
      Serial.print("failed, rc=");
      Serial.print(client.state());
      delay(5000);
    }
  }
  client.subscribe("spotify/rfid/in/#");
}
void callback(char* topic, byte* payload, unsigned int length) {
 
  Serial.print(F("Called"));
   Rflag=true; //will use in main loop
   r_len=length; //will use in main loop
   Serial.print("length message received in callback= ");
   Serial.println(length);
   int j=0;
     for (j;j<length;j++) {
       buffer2[j]=payload[j];
       }
if (r_len < 3) {
  Rflag=false;
  Serial.print(F("Set false"));
}
buffer2[j]='\0'; //terminate string
}

void loop() {
    if (!client.connected()) {
    reconnect();
  }
  client.loop();
  if (!mfrc522.PICC_IsNewCardPresent()) {
    return;
  }
  if (!mfrc522.PICC_ReadCardSerial()) {
    return;
  }
if (Rflag) {
        for (int i=0; i < 4; i++) {
    //data is writen in blocks of 4 bytes (4 bytes per page)
    status = (MFRC522::StatusCode) mfrc522.MIFARE_Ultralight_Write(pageAddr+i, &buffer2[i*4], 4);
    if (status != MFRC522::STATUS_OK) {
      Serial.print(F("MIFARE_Read() failed: (W) "));
      Serial.println(mfrc522.GetStatusCodeName(status));
      return;
    }
  }
  Serial.println(F("MIFARE_Ultralight_Write() OK "));
  Serial.println();
  Rflag=false;
}
  cardId = getCardId();
  char buffer3[10];
  sprintf(buffer3, "%lu", cardId);
  client.publish("spotify/rfid/id", buffer3);
  // Read data ***************************************************
  Serial.println(F("Reading data ... "));
  //data in 4 block is readed at once.
  status = (MFRC522::StatusCode) mfrc522.MIFARE_Read(pageAddr, buffer, &size);
  if (status != MFRC522::STATUS_OK) {
    Serial.println(F("MIFARE_Read() failed: (R)"));
    Serial.println(mfrc522.GetStatusCodeName(status));
    return;
  }

  Serial.println(F("Read data: "));
  //Dump a byte array to Serial
  for (byte i = 0; i < 5; i++) {
    Serial.write(buffer[i]);
       buffer2[i]=buffer[i];
    }
  client.publish("spotify/rfid/idlms", buffer,5);
  delay(1000);
  mfrc522.PICC_HaltA();
}

unsigned long getCardId() {
  byte readCard[4];
  for (int i = 0; i < 4; i++) {
    readCard[i] = mfrc522.uid.uidByte[i];
  }
  return (unsigned long)readCard[0] << 24
    | (unsigned long)readCard[1] << 16
    | (unsigned long)readCard[2] << 8
    | (unsigned long)readCard[3];
}

Uilleann Pipe recordings

Best Uilleann recordings I own or listen to.

Do you know any other good recordings? Let me know.

Uilleann CDs (no order)

  • Liam O’Flynn – The Pipers Call
  • Davy Spillane – Atlantic Bridge, Pipedreams, Out of the Air
  • Paddy Keenan – The Long Grazing Acre
  • Sean McKeon – The Dusty Miller ( Multiple players playing harmony)

Calum Stewart (I know him from his Flute playing)
I play “Am Monadh Ruadh” from this CD, also Randolph’s Leap is awesome.
Look up “Randolph’s Leap”. I’ve been there, beautiful.
(A better name should be Cummings Leap)

Brian McNamara

He plays a ‘flat’ set pitched in ‘C’ made by Geoff Wooff in 1997 and a ‘concert-pitched’ set of pipes made by Peter Maguire, I was lucky enough to have him as my teacher in Drumshanbo.

Single tracks I like

High energy playing of Blackie O’Connoll. He was my tutor when I attended Tionol 2011

Fred Morrison‘s Kansas City Hornpipe

Paddy Keenan – Harvest Home & Boys of blue hill
(Check The Pipering Of Willie Clancy Vol II)

Doinna by John McSherry (I play this one also, but it is nothing compared to his pipe-sound, melodic virtuosity and feeling he puts in this relatively easy piece of music)

Another often played CD with Uileann, Borderpipes and Low Whistles is:

Partners in Crime by Jarlath Henderson and Ross Ainslie.
A very nice combination of two different pipes together.
Coline and I try to have at least one set with both instruments.

Some others:

  • Some tracks of Bad Shepherds
  • Some tracks of Afro Celt Sound System
  • Some tracks of Enya (See Sun in the stream post)

List of Artist i’ve got recordings from:

Cillian Vallely, Finbar Furey, Ronan Browne, Willie Clancy, Seamus Ennis, Johnny Doran, Leo Rowsome, Liam O’Flynn,Davy Spillane, Paddy Keenan, Finbar Furey, Brian McNamara, Paddy Moloney, Jerry O’Sullivan, Gay Conor, Sean McKeon, Declan Masterson, Michael McGoldrick I probably missed several

Female pipers