Shop OBEX P1 Docs P2 Docs Learn Events
Flute to sheet music - Pic32 - Circuit Cellar - Sept 2020 - Ken this needs to be done on a P2 :) — Parallax Forums

Flute to sheet music - Pic32 - Circuit Cellar - Sept 2020 - Ken this needs to be done on a P2 :)

Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
edited 2020-08-21 04:13 in Propeller 2
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.

Comments

  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2020-08-21 03:20
    It was cool how they imported the MIDI notes directly to the sheet music :)
  • Hey thats neat Bob

    Pretty sure Ken plays clarinet
  • @Tubular
    Pretty sure Ken plays clarinet

    Ok thanks, I updated it to Clarinet. :)





  • cgraceycgracey Posts: 14,133
    I wonder if they chose flute over other instruments because it has fewer harmonics and would therefore have a cleaner FFT.
  • @cgracey
    I wonder if they chose flute over other instruments because it has fewer harmonics and would therefore have a cleaner FFT

    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.
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2020-08-21 14:30
    - The shortest note they can detect is a quarter note.

    - 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.


  • Just listening/viewing a truly-inspired presentation from Ian Anderson is enough, to notice how much his respiration and lips are coordinated/focused, "convincing" his flutes to reach the higher pitches.

    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
  • cgraceycgracey Posts: 14,133
    There are some amazing audio products these days:



    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:

  • rosco_pcrosco_pc Posts: 452
    edited 2020-08-22 05:07
    deleted (was already added, should've stayed in bed today)
  • kubakuba Posts: 94
    edited 2020-08-22 08:09
    Side note: The thing about flute being harmonic-free or "pure tone" is kinda silly. It's not even close, and not particularly close when compared to other instruments either. It's especially puzzling to me because everyone here has surely heard a sine wave on speaker at least once. After experiencing that - just once - it takes subsequently a serious hearing loss to be unable to tell apart a flute from a sine wave... It's extremely hard to produce an acoustically pure enough tone (a sine wave) with anything physical - even a sine wave played through most speakers sounds like a sine wave played through speakers, and we can tell that it's colored by the relatively terrible speaker nonlinearities. You can run it through an acoustic resonator to filter out the junk, but then you start hearing the harmonics exciting the nonideal behavior of the resonator itself... so then you have to really damp out everything but the fundamental out of the resonator, while preserving the high Q of the fundamental, so it's selective enough of an acoustic filter, without being heard itself. If you don't have any acoustic experience, just basic engineering chops, it's doable, but a very tall order and takes plenty of dedication.

    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.
  • Thanks @"Bob Lawrence (VE1RLL)" . The clarinet has sub-pitches that need to be detected. I made a working pitch detector with the Propeller 1 using some of Pete Hemery's work http://petehemery.github.io/Final-Year-Project/Dissertation.pdf (I found a 2014 forum thread where you posted this code, which must've got me started back then).

    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

  • Ken - it's off-topic but since you play Clarinet, have you ever tried to use these to work on your reeds? https://www.harborfreight.com/5-piece-m2-high-speed-steel-mini-tool-bits-for-metalworking-lathes-40641.html

    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.
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2020-09-01 09:18
    @Ken Gracey
    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.

    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:
    SteelGuiatarTabExample.png

    Tab - Delphi Program
    SteelTab.png
    SerialPort.png

    MainForm.png

    Parcial Schematic of Steel Rider (1 board)
    2793_SteelriderTop_S5_S7_1.jpg

    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 :)

    Franklin.jpg
    986 x 734 - 16K
    1024 x 745 - 182K
    670 x 421 - 162K
    400 x 300 - 19K
Sign In or Register to comment.