Category Archives: Music

In the middle of recording Mhairi Bhan Og

Also known as Mary Young and Fair – this Gaelic air was published in Capt Simon Fraser’s “Knockie” Collection of 1816.

I made an arrangement using Musescore, Ardour and Bagpipe Music Writer.

Hardware used: Tascam 2488, Behringer B-1 studio microphone, Yamaha QY-100 sequencer, ESI MidiMate eX USB 2.0 MIDI-interface and Shepherd Smallpipes.

Musescore
Ardour remixing, using QY-100 via midi and Sound Fonts

(I tried Qtractor and some other tools but liked Ardour more)

Recording online soon, I have to re-record the harmony part.
Maybe I’m going to add a Flute part also.

PDF

Today some lasercutting for Home Assistant Spotify RFID

see:

Lasercutting a case and the playlist selectors.

Close-up RFID stickers I’m using.

Below is a test with different methods.
I like reading the booklets, so a CD i cool, and I don’t need a CD player.
(The RFID tag is in the case)
The little cards are for bought audio files I don’t have a physical CD for.

Wooden case with RFID reader being powered by external powerbank

What am I gonna do?
Cube as I had? Wooden playlist selectors as in above movies?
The cards I’ve printed?
Maybe a small record player with an RFID reader inside?

3D printed like this? https://makerworld.com/en/models/66671
UPDATE: 20240327 – Little Record I 3D printed with little groves.

Home Assistant code for Playlist and Album automations
(B.t.w. The method is still using an Arduino and MQTT topics, as mentioned before)

# ALBUM PLAYER
alias: SpotifyAlbum
description: ""
trigger:
  - platform: mqtt
    topic: spotify/rfid/id
condition:
  - condition: template
    value_template: "{{ trigger.payload in playlistkeys.keys() }}"
action:
  - service: media_player.play_media
    target:
      entity_id: media_player.spotify_fashice
    data:
      media_content_type: album
      media_content_id: spotify:album:{{ playlistkeys.get(trigger.payload) }}
mode: single
variables:
  playlistkeys:
    "71719674": 20TANs4iXVeLp387zjgmec
    "71260666": 5325ECcBhnIysoqyENGCYi
    "71457530": 7wyOeD9HcUuMFMO8pTflap
# PLAYLIST PLAYER
alias: SpotifyCube
description: ""
trigger:
  - platform: mqtt
    topic: spotify/rfid/id
condition:
  - condition: template
    value_template: "{{ trigger.payload in playlistkeys.keys() }}"
action:
  - service: media_player.play_media
    target:
      entity_id: media_player.spotify_fashice
    data:
      media_content_type: playlist
      media_content_id: spotify:user:spotify:playlist:{{ playlistkeys.get(trigger.payload) }}
variables:
  playlistkeys:
    "69229050": 0SOay3RkjojjevrF5lHMON
    "69491194": 5f8w3UHlD9Ozz6Y4VHs6kF
    "69753338": 0bJvpsn0TDZwIDUjz4d75S
    "70015482": 37i9dQZF1DX9HwI3Crikcm
    "70277626": 37i9dQZF1EQmK1rjZuPGDt
    "70539770": 2KeRLMmGMxI5UgzE7m0iCp

In the past, Aloha and I made a simple solution like this using barcodes in < 2000s.
Due to the many obscure recordings I have, I am thinking about creating something like this for Picore player and my local Squeezebox server.

Logitech Squeezebox / Media Server Solution

alias: squeezealbumplay
description: ""
trigger:
  - platform: mqtt
    topic: spotify/rfid/id
condition:
  - condition: template
    value_template: "{{ trigger.payload in playlistkeys.keys() }}"
action:
  - service: squeezebox.call_method
    target:
      entity_id: media_player.squeezebox
    data:
      command: playlist
      parameters:
        - play
        - "{{ playlistkeys.get(trigger.payload) }}"
mode: single
variables:
  playlistkeys:
    "71719674": /tank/celtic/Celtic/M/Martyn Bennett/Bothy Culture/
    "71719675": /tank/celtic/Celtic/D/Davy Spillane/Atlantic Bridge/
    "2159056458": /tank/celtic/Celtic/M/Michael McGoldrick/Arc/

Revisiting the Spotify Cube

In the past I posted about my genre selector for Spotify using a cube.

UPDATE: 20240501 below – using esphome

Most was done using NodeRed and a python script.

Now, I’ve moved it to Home Assistant using a single automation.
(Maybe the Arduino sketch can be made with Esphome also.
But I don’t have time for that)
It still uses the Arduino sketch as before, which uses Mqtt to post the RFID code to Mosquitto.

My new Home Assistant automation

alias: SpotifyCube
description: ""
trigger:
  - platform: mqtt
    topic: spotify/rfid/id
condition:
  - condition: template
    value_template: "{{ trigger.payload in playlistkeys.keys() }}"
action:
  - service: media_player.play_media
    target:
      entity_id: media_player.spotify_fash
    data:
      media_content_type: playlist
      media_content_id: spotify:user:spotify:playlist:{{ playlistkeys.get(trigger.payload) }}
variables:
  playlistkeys:
    "70539770": 2KeRLMmGMxI5UgzE7m0iCx
    "70277626": 37i9dQZF1EQmK1rjZuPGDx
    "69229050": 0SOay3RkjojjevrF5lHMOx
    "70015482": 37i9dQZF1DX9HwI3Crikcx
    "69753338": 0bJvpsn0TDZwIDUjz4d75x
    "69491194": 5f8w3UHlD9Ozz6Y4VHs6kx

Some notes about above script:

  • The MQTT topic is configured in the sketch below
  • The playlist keys are at the bottom
    “RFIDID”: playliststring as can be found in web spotify

Pasted link

Arduino Code

#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);
unsigned long cardId = 0;

WiFiClient net;
PubSubClient client(net);
const char* mqtt_server = "IPMQTTBROKER";
const char* ssid = "MYSSID";
const char* password = "MYWIFIPASSWORD";

void setup() {

  Serial.begin(115200);
  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 = "NodeMCUClient-";
    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) {
    String topicStr = topic;
      byte value = atoi((char*)payload);
}

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

  if (!mfrc522.PICC_IsNewCardPresent()) {
    return;
  }

  if (!mfrc522.PICC_ReadCardSerial()) {
    return;
  }

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

  uint8_t control = 0x00;
  do {
    control = 0;
    for (int i = 0; i < 3; i++) {
      if (!mfrc522.PICC_IsNewCardPresent()) {
        if (mfrc522.PICC_ReadCardSerial()) {
          control |= 0x16;
        }
        if (mfrc522.PICC_ReadCardSerial()) {
          control |= 0x16;
        }
        control += 0x1;
      }
      control += 0x4;
    }

    delay(0);
  } while (control == 13 || control == 14);

  reconnect();
  client.publish("spotify/rfid/id", "0");
  delay(500);

  mfrc522.PICC_HaltA();
  mfrc522.PCD_StopCrypto1();
}

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];
}

ESPHOME Config same as above

esphome:
  name: rfidtag
  friendly_name: rfidtag

esp8266:
  board: d1_mini

mqtt:
  broker: 192.168.1.1

# Enable logging
logger:

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

ota:
  password: "xxxxxxxxxxxxxx"

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: "xxxxxxxxxxx"

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: spotify/rfid/id
          payload: !lambda 'return x;'
  on_tag_removed:
    then:
      - mqtt.publish:
          topic: spotify/rfid/idremoved
          payload: !lambda 'return x;'

My google-fu is still strong (and Tunepal ramblings)

Google-Fu : (informal) Skill in using search engines (especially Google) to quickly find useful information on the Internet.

I was thinking of a famous piece of music, but what was it?

Whistling it, while using Shazam or Tunepal, didn’t work.

So I googled “well known classical part repeats sped up and transposes”

The second link was a Reddit link named : “Need help finding a song that starts very slow and builds to be frantic!”

First YT link in there: In the Hall of the Mountain King (Peer Gynt) by Edvard Grieg

Epic tune!

“In the Hall of the Mountain King” is a piece of orchestral music composed by Edvard Grieg in 1875 as incidental music for the sixth scene of act 2 in Henrik Ibsen’s 1867 play Peer Gynt. It was originally part of Opus 23 but was later extracted as the final piece of Peer Gynt, Suite No. 1, Op. 46.

I’ve used Tunepal many times, it’s great for folkies!

Sometimes it works also on classical pieces, because they were arranged into folk music.

https://tunepal.org/

I bought the Android app, because I liked it so much.

Tunepal is a search-by-playing search engine for traditional Irish, Welsh, Scottish, Breton, American marching band and Canadian tunes.
By playing a 12-second extract from a traditional tune on an instrument such as the flute or fiddle, you can:

  • Retrieve score matches from a database of over 24,000 music scores
  • View and playback, share and download the score
  • Find and play other recordings of the tune from a collection of over 30 million recordings

Tunepal is a search-by-playing search engine for traditional Irish, Welsh, Scottish, Breton, American marching band and Canadian tunes.

On the Record page, click the Tunepal logo or tap the screen if your computer has a touch screen. Start playing straight away. Don’t wait for the countdown to complete. Tunepal works best if there is no silence at the start of the recording.

Tunepal works best with “legato” style instruments such as the tin-whistle, flute, concertina, accordion, pipes and fiddle. It doesn’t work very well with “plucked string” instruments such as the banjo and harp.

To find a tune using Tunepal, first make sure you have a PC microphone connected to your computer or use the phone app

If your instrument uses a different “fundamental note” to the usual D (for example you are playing a C flute) or you are playing a tune in an unusual key, then you can adjust the transcription algorithm by choosing a different “fundamental” from the settings page.

You can filter the search results from the settings page to limit searches to certain tunebooks or time signatures.

Three channel mixer for ay-3-8910 is almost done.

At the back the 8 pin single channel lm368 amplifier.
At the front the 3 channel setup.
I still have to tweak the resistors, and potmeters.
Then I can make a permanent PCB, and figure out the connections to the 6502.

At the moment, the Arduino Nano is playing some real sound samples by using the registers of the sound chip.
The music is being played by sending the register dumps directly to the chip.

Much like i’ve been using SID register dumps to play songs in another project.

This is version 0.1 .. do not use.
If its wrong, or can do better please mail me.
Oh it needs a 1k resistor from the 20K’s to ground I think.

Music top .. dunno

Warning .. nerd stuff ahead, many many more.
These are the ones I currently can think off.

Sid music (commodore C64)

  • Rob Hubbard – Monty on the run
  • Chris Huelsbeck – R-type
  • Chris Heulsbeck – Great Giana Sisters
  • Jeroen Tel – Cybernoid 2

Northumbrian pipes

Concertina

Banjo

Irish Bouzouki

Mandoline

  • Tim Connell Jack Dwyer – The Rakish Paddy
  • Luke Plumb (Plays with Shooglenifty) – Drunken Landlady

Borderpipes

  • Ali Hutton
    Terrortime
  • Ross Ainsley
    (Partner’s in Crime CD)

Great Highland Bagpipe (TO many)

  • Fred Morrison
    Frances Morton’s

Irish Flute / Whistle

  • Michael McGoldrick – Angel Meadow
  • Fraser Shaw – Air Chall

Uilleann Pipes

Other pipes

Callum Armstrong (with Branschke)
https://www.youtube.com/@CallumArmstrongPiping
Angie’s Jig on double chanter, I love that tune
He even has a tripple chanter
https://youtu.be/bGIhFBwItHA

Other instruments

Balalaika – Aleksei Arkhipovsky
https://www.youtube.com/watch?v=5JqeSU7lSLE

Throat singing:

Folk instruments (other)

I know/play and like Irish/Scottish/Celtic music.

Whenever I come across a musical instrument I want to try it.

But here are some others I like

Guzheng (Instrument)

Altai – Bai Terek (Band) – Throatsinging and Tovshuur instrument

Alexei Arkhipovskiy – Balalaika

Ney Flute (Egyptian)

Kyiv Ethno Trio – Overtone Flute (no fingerholes)

Largest flute (at the end)

Also cool (Flute with “drone”)

Didgeridoo

Jaw Harp (I’ve got one, but i’m not good at it)
also known as : Jew’s harp, mouth harp, Ozark harp, juice harp, murchunga, guimbarde, mungiga, vargan, trompe

Not an ancient instrument, but cool nevertheless.
I play Misirlou on BorderPipes using accidentals, I’ll upload this soon.

Found a crappy recording of Misirlou on my Borderpipes.
C-sharp, B-flat, F-Natural and G-sharp as accidentals.
Hard to play on Great Highland Bagpipe without using a lot of tape. 🙂

Something I want to make myself : A talharpa.
https://en.wikipedia.org/wiki/Talharpa

A sausage fagott 🙂
https://en.wiktionary.org/wiki/Wurstfagott

Busy weekend .. didn´t have time to post

I’ve got my SDK-85 cassette interface PCB’s in, If you want to have the Kicad files. Message me.

My 3D printer has a worn out hot-end .. so a new one to install.

BBQ time! .. That’s from 1-januari till 31-december .. rain, snow storm whatever.
I’ve made a lot of Rubs/Sauces and marinades.
But a new book i always welcome ..

Also new recipes and tips. Let me know.

Sunday a day of music with our folkband.
Played some old and new tunes.

Did some Vulkan / OpenGL benchmark testing.

Cleaned and fixed our wine cellar.

And tomorrow i’m starting new work.

Flute note detection with leds

Yesterday I got my MAX9814 in, last night I got it working.
Used the leds from a lightpainter project to test controlling the leds.

Why is it, that it doesn’t matter how much components and ledstrips you buy, you alway need more.

First parts of the Scale, then a part of Farewell to Uist

Arduino Nano, using FastLeds library and FFT.
Ledstrip is WS2812, and the MAX8914 microphone