want to convert humming to midi -- is Csound the right framework?
Date | 2015-12-01 17:08 |
From | Brian Merchant |
Subject | want to convert humming to midi -- is Csound the right framework? |
Hi all,
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
I am a total newbie, so I might be asking a question that is not a good one -- I couldn't even clearly understand the results of my google searches on the matter! I am wondering if Csound has the capacity for pitch detection? I am interested in this because I'd like to write a toy script to take some audio input (humming) and convert it into midi regardless of its original form. Would this be possible using Csound's framework? From my google search, I found out about something called `psvpitch`: This seems to be exactly what I am looking for, unless I am misunderstanding? Kind regards, Brian |
Date | 2015-12-01 17:35 |
From | Michael Gogins |
Subject | Re: want to convert humming to midi -- is Csound the right framework? |
Csound does have some capacity for pitch detection. However, what it has is a toolkit that needs to be assembled into an application with code. There is commercial software, often with proprietary advances in the state of the art, that is already designed to do this job, usually as part of a mainstream audio workstation (not cheap, but not expensive considering what you get), or as a plugin. Caveat: None of this stuff seems to work all that well. Don't be hasty. You might want to start by seeing what you can get to work in Csound, then you will be up to speed with how this stuff usually works and better informed to evaluate other software. Regards, Mike ----------------------------------------------------- Michael Gogins Irreducible Productions http://michaelgogins.tumblr.com Michael dot Gogins at gmail dot com On Tue, Dec 1, 2015 at 12:08 PM, Brian Merchant |
Date | 2015-12-01 17:37 |
From | Michael Gogins |
Subject | Re: want to convert humming to midi -- is Csound the right framework? |
PS, there is a list of relevant plugins here: http://www.vamp-plugins.org/download.html Regards, Mike ----------------------------------------------------- Michael Gogins Irreducible Productions http://michaelgogins.tumblr.com Michael dot Gogins at gmail dot com On Tue, Dec 1, 2015 at 12:35 PM, Michael Gogins |
Date | 2015-12-01 17:44 |
From | Forrest Curo |
Subject | Re: want to convert humming to midi -- is Csound the right framework? |
I'm looking for a .csd file I put together from tinkering with one of Iain McCurdy's examples ( http://iainmccurdy.org/csound.html ) and as you've been told, this stuff doesn't work all that well.-- On Tue, Dec 1, 2015 at 9:35 AM, Michael Gogins <michael.gogins@gmail.com> wrote: Csound does have some capacity for pitch detection. However, what it |
Date | 2015-12-01 18:06 |
From | Forrest Curo |
Subject | Re: want to convert humming to midi -- is Csound the right framework? |
I think this is what I used to turn a (filtered) recording of my voice into a recording of a csd instrument playing approximately the same notes & etc. [Please forgive the clunkiness; you might better search out the McCurdy examples & try whatever tinkering best fits your voice & your system. ------ <CsoundSynthesizer> <CsOptions> ; Select audio/midi flags here according to platform -odac ;;;RT audio out ;-iadc ;;;uncomment -iadc if RT audio input is needed too ; For Non-realtime ouput leave only the line below: ; -o diskin2.wav -W ;;; for file output any platform </CsOptions> <CsInstruments> sr = 44100 ksmps = 128 nchnls = 2 0dbfs = 1 gisf1 sfload "FluidR3_GM.sf2" sfplist gisf1 ;list presets of first soundfont gi init 0 label: gir sfpreset gi,0,gisf1,gi gi = gi +1 if gi < 128 goto label gkamp init .25 instr 1 a1 diskin2 "3.ogg", 1, 0, 1, 0, 32 kfr init 1 knote init 1 kchange init 0 ktim init 0 ktim0 init 0 ifftsize = 2048 iwtype = 1 /* cleaner with hanning window */ a2 = a1*2 fsig pvsanal a2, ifftsize, ifftsize/2, ifftsize, iwtype fsig2 pvsbandp fsig, 35, 40, 200, 300, 0 ;PERFORM fsig BAND PASS FILTERING kfr, kamp pvspitch fsig2, 0.01 if (kamp < 0.1) then ktim0 timek endif gkamp = kamp * .0001 ;------- kfr1 = kfr* .0045454 ;------- printk 0, ktim printk 0, ktim - ktim0 ktim timek if (ktim -ktim0 >= 125) then ; knew = round(12 * (log(kfr/220)/log(2)) + 57) if (kamp != 0) then event "i", 2, 0, 1, gkamp, kfr1 endif endif endin ;-------- instr 2 kfr init p5 aenv linsegr 1, 1, 1, 1, 0 ;envelope aL, aR sfplay3 60, 60, gkamp, kfr, 92, 0 aL = aL * aenv aR = aR * aenv outs aL, aR outs aL, aR endin instr 99 allL, allR monitor ;write output to a wav file: 16 bits with header fout "4.wav", 14, allL, allR endin </CsInstruments> <CsScore> i 1 0 500 i 99 0 250 e </CsScore> </CsoundSynthesizer> On Tue, Dec 1, 2015 at 9:44 AM, Forrest Curo <treegestalt@gmail.com> wrote:
|
Date | 2015-12-02 13:53 |
From | Iain McCurdy |
Subject | Re: want to convert humming to midi -- is Csound the right framework? |
There are actually quite a few opcodes dedicated to tracking pitch, each with their own strengths and weaknesses. You can find a survey of them in the FLOSS manual: My own examples demonstrating them are here: Humming into each of these should provide some sort of indication which opcode will work best for you. To convert audio into MIDI note events you will probably want to involve amplitude tracking also (some opcodes include this built-in) to detect note-ons and then note durations. You should also consider processing of the audio before it goes into the pitch tracker - filtering, compressing and gating to remove unwanted noise and noisy note attacks if present - and smoothing and quantising of the data output to remove the element of human inaccuracy before translating to MIDI events. I think these ancillary procedures are key to getting the best out of the pitch tracking opcodes. Iain. Date: Tue, 1 Dec 2015 09:08:11 -0800 From: bhmerchant@GMAIL.COM Subject: [Csnd] want to convert humming to midi -- is Csound the right framework? To: CSOUND@LISTSERV.HEANET.IE Hi all,
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted hereI am a total newbie, so I might be asking a question that is not a good one -- I couldn't even clearly understand the results of my google searches on the matter! I am wondering if Csound has the capacity for pitch detection? I am interested in this because I'd like to write a toy script to take some audio input (humming) and convert it into midi regardless of its original form. Would this be possible using Csound's framework? From my google search, I found out about something called `psvpitch`: This seems to be exactly what I am looking for, unless I am misunderstanding? Kind regards, Brian |
Date | 2015-12-02 14:28 |
From | Anders Genell |
Subject | Re: want to convert humming to midi -- is Csound the right framework? |
Attachments | audio_to_midi.csd |
Öyvind Brandtsegg was quite successful in getting their MIDI pipe organ to talk (http://theforeigner.no/pages/news/norway-academic-makes-the-organist-redundant/) using a csd he graciously provided, which I attach here copied directly from his mail from February 2013.
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Regards, Anders On Wed, Dec 2, 2015 at 2:53 PM, Iain McCurdy <i_mccurdy@hotmail.com> wrote:
|
Date | 2015-12-02 21:47 |
From | Justin Smith |
Subject | Re: want to convert humming to midi -- is Csound the right framework? |
Generating a set of frequencies that produces a result that is equivalent (or close enough) to some input signal is straightforward. Mathematically, there are an infinite number of solutions - an infinite set of combinations of frequencies that will each combine in their grouping model any given input. Detecting "the pitch" which a human ear would recognize in a sound is much much harder - there's only one answer and the relationship to the input signal is much less straightforward than intuition would lead you to believe. On Wed, Dec 2, 2015 at 6:29 AM Anders Genell <anders.genell@gmail.com> wrote:
|
Date | 2015-12-02 23:08 |
From | Brian Merchant |
Subject | Re: want to convert humming to midi -- is Csound the right framework? |
Hi all, Thanks very much for the hints, tips, advice, and code examples! This is way more than I expected! > Generating a set of frequencies that produces a result that is equivalent (or close enough) to some input signal is straightforward. Mathematically, there are an infinite number of solutions - an infinite set of combinations of frequencies that will each combine in their grouping model any given input. Detecting "the pitch" which a human ear would recognize in a sound is much much harder - there's only one answer and the relationship to the input signal is much less straightforward than intuition would lead you to believe. No doubt I'll have to do a lot of tweaking -- I didn't expect a perfect or easy solution, so I suppose my expectations were reasonably low coming in. Kind regards, Brian On Wed, Dec 2, 2015 at 1:47 PM, Justin Smith <noisesmith@gmail.com> wrote:
|