Flute to sheet music - Pic32 - Circuit Cellar - Sept 2020 - Ken this needs to be done on a P2 :)
Bob Lawrence (VE1RLL)
Posts: 1,720
Video
https://circuitcellar.com/inside-this-issue/
From the magazine:(September #362)
Motivated by the tedious nature of the sheet music
annotation process, these three Cornell students built a
system designed as a music composition assistant for
composers, arrangers and musicians at all levels. Called
PICcompose, this is a PIC32 MCU-based, end-to-end tool
that converts raw audio from playing an instrument
directly into an editable sheet music score. In this article,
they describe the design and components of the system
========================================================================
During our Zoom chat last night we discussed P2 Pitch detection & Pitch to MIDI. Ken indicated that he was interested in pitch detectin for his clarinet.
https://circuitcellar.com/inside-this-issue/
From the magazine:(September #362)
Motivated by the tedious nature of the sheet music
annotation process, these three Cornell students built a
system designed as a music composition assistant for
composers, arrangers and musicians at all levels. Called
PICcompose, this is a PIC32 MCU-based, end-to-end tool
that converts raw audio from playing an instrument
directly into an editable sheet music score. In this article,
they describe the design and components of the system
========================================================================
During our Zoom chat last night we discussed P2 Pitch detection & Pitch to MIDI. Ken indicated that he was interested in pitch detectin for his clarinet.
Comments
Pretty sure Ken plays clarinet
Ok thanks, I updated it to Clarinet.
Project:
https://people.ece.cornell.edu/land/courses/ece4760/FinalProjects/f2019/lpr46_tev22_dms486/lpr46_tev22_dms486/lpr46_tev22_dms486/index.html
Code:
https://github.com/laasya98/PICCompose
You may have hit the nail on the head as they say , it would be like a pure sine wave at the low end of the scale
From the web:
Flute harmonics
Featured snippet from the web
Harmonics are produced by overblowing a lower fundamental pitch. ... There are no harmonics possible in the lowest octave. Composers should note that, on any given fundamental, the higher the partial, the greater the resistance of the flute to produce the pitch.
- They get 100 % accuracy
- They use serial out to the PC.
- They import into a software package called MuseScore https://musescore.org/en
- They used a TFT display
I have the article and they did not mention why they the Flute as their instrument of choice.
The sounding of his deepest inspirations act like "preambles", antecipating (to our minds) what will comes next.
The point Chip brought is of great importance, and there are studies showing that, beyound FFTs, there are other ways to enhance the precision of digital acquisition of musical contents.
The ahead-linked work (2002), from Jeremy F. Alm and James S. Walker, could shed some light on those technics.
jameswalkermathmusic.net/media/38228%5b1%5d.pdf
These Waza Air headphones serve as both virtual amplifier, effects, and sound stage. The headphones have accelerometers in them, in order to move the sound stage as you move your head:
If my limited experience is any indicator, it took weeks to get to a 90-100dB purity of the acoustic single tone source, taken "literally" i.e. so it was mostly independent of how far away did you listen to it, and from what direction. And measuring that was fun, too: you need a reflective membrane and a laser interferometer, otherwise you wage endless war against nonideal behavior of most microphones. Just getting the interferometer setup validated to that sort of dynamic range was not trivial. And you have to do all that in a somewhat stuffy anechoic room - I couldn't stand being there for more than 4 hours at a time... It's nice how quiet it is for the first hour or two, given the contrast from the urban environment. After that it became tiring in itself.
But, once you calibrate your ear with that sort of a tone, a.k.a. just hear it for a minute or two - it's pretty damn obvious that no "simple" acoustic device can match it, and there is no instrument that comes anywhere close to sounding like that. Those decades worth of a chasm are really easy to hear, and it's uncanny for me how deeply "ingrained" such a pure reference can become. I can still hear it in my mind, and its seemingly infinitely artificial quality is indelebile, it'd seem. It's about as alien of an acoustic experience as one can get. We simply don't have that sort of experience as humans, not ever, not untless we pursue it. And thus, for the vast majority of instruments, including everything in a classical orchestra, a $100 speaker coupled to a decent sine generator is already too good of a reference standard - nothing in the orchestra sounds like it.
The clarinet is a bit tricky. It has additional harmonics which must be identified to secure the note: https://newt.phys.unsw.edu.au/jw/clarinetacoustics.html Chip has told me "easy job for the P2" but I need some examples to work from.
My other project with the P1 and music is here https://learn.parallax.com/tutorials/language/blocklyprop/visual-metronome-project
I'm at my happiest when I get to work on projects like this, which has been so rare in recent years due to business demands. Happy to see you bringing this to the surface for me and others.
Ken Gracey
It's like the long edge of a ReedGeek, but much cheaper. Maybe a good option for kids who might lose them or drop them (so cheap), and can't take reed knives to school.
I remember your project Ken.It turned out great. With the P2 we can improve it. There are a few of the Prop Heads interested in Pitch to MIDI. I'm sure that with all the brainpower on here and with the new features of the P2 we can make a great pitch detector. Chip will help and JonnyMac is already working on a MIDI object. I'm sure the Aussie Python team will help out with Python scripts etc when we get that far. I am putting together some info to start a topic on P2 Pitch detection and it will be fun to see how many methods we come up with on the P2. There are many forms of FFT to try and I will try it non-FFT based on a commercial design - IVL Steel Rider, a commercial design for Steel Guitar with a microcontroller-based pitch to MIDI converter from around 1985, made in Canada
I don't play clarinet but I do understand the challenges of detecting pitch with one. I play Pedal Steel Guitar and it’s even more difficult with so many possible notes and note combinations.
https://en.wikipedia.org/wiki/Pedal_steel_guitar
I have two necks with a 10 string E9th tuning on the first neck and a C6th tuning on the second neck. It also has 5 knee Leavers and 9-floor Pedals to lower and raise string pitch. It can be very challenging to detect the pitch of all the notes but the IVL Steel Rider(made in Canada) did very well at pitch detection just using 0831 ADC's (8 bit) and 6 8031 Microcontrollers. (Intel 8 bit with 2-16 bit counters, 4 - IO ports), 2764 EPROM. Just think about how more advanced the Propeller Chip (P2) is
Also, most Pedal Steel players don’t play by note’s, we use a Tab system based on numbers to represent the notes played. I’m hoping to make a Pitch to Midi converter and capture the output to my computer into a Delphi program that I am working on to automatically produce the tab. I added a few pictures to show what a Tab layout looks like and a screenshot of the program I’m working on. It will be a fun winter project.
Tab Example:
Tab - Delphi Program
Parcial Schematic of Steel Rider (1 board)
My Franklin Pedal Steel Guitar that was custom made in Nashville in 2004. I was on a 2-year waiting list to get it
With 9 floor pedals and 5 Knee levers to change the pitch of the strings, may take 15 accelerometers. It's great that that P2 has so many I/O pins