[Csnd] Convert cps to MIDI note
Date | 2018-06-16 15:36 |
From | "Jeanette C." |
Subject | [Csnd] Convert cps to MIDI note |
Hi Csounders, is there already any opcode or UDO that would convert a pitch in Hz - i.e. cps - to a MIDI note number? I can think of ways how to implement it myself, but given half a chance, I wouldn't. :) Best wishes and thanks, Jeanette -------- * Website: http://juliencoder.de - for summer is a state of sound * SoundCloud: https://soundcloud.com/jeanette_c * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g * GitHub: https://github.com/jeanette-c * Twitter: https://twitter.com/jeanette_c_s Open my eyes, I look deep inside, I run away... <3 (Britney Spears) 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 |
Date | 2018-06-16 15:54 |
From | Vincent Michalke |
Subject | Re: [Csnd] Convert cps to MIDI note |
Hi, there is a UDO by Joachim Heintz for this purpose: On Sat, Jun 16, 2018 at 4:35 PM Jeanette C. <julien@mail.upb.de> wrote: Hi Csounders, |
Date | 2018-06-16 16:05 |
From | "Jeanette C." |
Subject | Re: [Csnd] Convert cps to MIDI note |
Jun 16 2018, Vincent Michalke has written: ... > https://github.com/csudo/csudo/blob/master/midi/midi.udo ... Thanks, exactly what I need! Best wishes, Jenaette -------- * Website: http://juliencoder.de - for summer is a state of sound * SoundCloud: https://soundcloud.com/jeanette_c * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g * GitHub: https://github.com/jeanette-c * Twitter: https://twitter.com/jeanette_c_s Open my eyes, I look deep inside, I run away... <3 (Britney Spears) 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 |
Date | 2018-06-16 18:45 |
From | luis antunes pena |
Subject | Re: [Csnd] Convert cps to MIDI note |
It would be great if this could turn into an opcode in a future
version of csound ;) Best, Luis Am 16.06.18 um 17:05 schrieb Jeanette
C.:
Jun 16 2018, Vincent Michalke has written: |
Date | 2018-06-16 18:51 |
From | jpff |
Subject | Re: [Csnd] Convert cps to MIDI note |
Should not that UDO take account of the value of A4? On Sat, 16 Jun 2018, luis antunes pena wrote: > It would be great if this could turn into an opcode in a future version of > csound ;) > Best, > Luis > > Am 16.06.18 um 17:05 schrieb Jeanette C.: > Jun 16 2018, Vincent Michalke has written: > ... > https://github.com/csudo/csudo/blob/master/midi/midi.udo > > ... > > > -- > http://luisantunespena.eu > http://sumtone.com > 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 > 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 |
Date | 2018-06-16 18:52 |
From | jpff |
Subject | Re: [Csnd] Convert cps to MIDI note |
Implementing in code is close to trivial once in is decided exacly what it should do. On Sat, 16 Jun 2018, luis antunes pena wrote: > It would be great if this could turn into an opcode in a future version of > csound ;) > Best, > Luis > > Am 16.06.18 um 17:05 schrieb Jeanette C.: > Jun 16 2018, Vincent Michalke has written: > ... > https://github.com/csudo/csudo/blob/master/midi/midi.udo > > ... > > > -- > http://luisantunespena.eu > http://sumtone.com > 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 > 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 |
Date | 2018-06-16 21:52 |
From | jpff |
Subject | Re: [Csnd] Convert cps to MIDI note |
Of course the opcode cpsmidinn already exists 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 |
Date | 2018-06-16 22:40 |
From | jpff |
Subject | Re: [Csnd] Convert cps to MIDI note |
I have mplemented an opcode midinncps that does the same as the UDO excepyt it works relative to th A4 value. Simple testing only so far. Should be in 6.12 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 |
Date | 2018-06-16 22:45 |
From | "Jeanette C." |
Subject | Re: [Csnd] Convert cps to MIDI note |
Jun 16 2018, jpff has written: > I have mplemented an opcode midinncps that does the same as the UDO excepyt > it works relative to th A4 value. Simple testing only so far. Should be in > 6.12 Great job! Thanks John! ... Best wishes, Jeanette -------- * Website: http://juliencoder.de - for summer is a state of sound * SoundCloud: https://soundcloud.com/jeanette_c * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g * GitHub: https://github.com/jeanette-c * Twitter: https://twitter.com/jeanette_c_s I'm so curious, what do you think of me <3 (Britney Spears) 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 |
Date | 2018-06-16 23:48 |
From | thorin kerr |
Subject | Re: [Csnd] Convert cps to MIDI note |
There's also the ftom opcode, and the docs say it takes A4 into account. Thorin On Sun, 17 Jun. 2018, 7:45 am Jeanette C., <julien@mail.upb.de> wrote: Jun 16 2018, jpff has written: |
Date | 2018-06-16 23:58 |
From | "Dr. Richard Boulanger" |
Subject | Re: [Csnd] Convert cps to MIDI note |
Thanks John!! Sent from my iPhone
|
Date | 2018-06-17 12:19 |
From | luis antunes pena |
Subject | Re: [Csnd] Convert cps to MIDI note |
That's great. I was not aware of the midinncps and also of the
ftom and mtof opcodes. Thank you! Am 17.06.18 um 00:58 schrieb Dr.
Richard Boulanger:
Thanks John!! |
Date | 2018-06-17 12:44 |
From | jpff |
Subject | Re: [Csnd] Convert cps to MIDI note |
Yes, ftom (frequency to MIDI) does what the UDO does with the minor change that it does not have the optional parameter to round to integer, but there is the int opcode for that. I am withdrawing my code as unnecessary. Perhaps I should spend more time reading the manual.... On Sun, 17 Jun 2018, thorin kerr wrote: > There's also the ftom opcode, and the docs say it takes A4 into account. > > Thorin > > On Sun, 17 Jun. 2018, 7:45 am Jeanette C., |
Date | 2018-06-17 13:27 |
From | luis jure |
Subject | Re: [Csnd] Convert cps to MIDI note |
el 2018-06-17 a las 12:44 jpff escribió: > Yes, ftom (frequency to MIDI) does what the UDO does with the minor > change that it does not have the optional parameter to round to integer, > but there is the int opcode for that. What about adding an optional parameter to ftom to round to integer, like in Joachim's UDO? It wouldn't break backwards compatibility and it would be more elegant, IMO. -- 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 |
Date | 2018-06-17 13:58 |
From | "Jeanette C." |
Subject | Re: [Csnd] Convert cps to MIDI note |
Jun 17 2018, jpff has written: ... > Perhaps I should spend more time reading the manual.... ... Hi John, honestly, the ftom was rather hidden. At least, it didn't show up under pitch converters and not in the relevant MIDI section. Having the rounding as an optional parameter would be nice, make for shorter and slightly more elegant code. Thanks again for your help, Jeanette -------- * Website: http://juliencoder.de - for summer is a state of sound * SoundCloud: https://soundcloud.com/jeanette_c * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g * GitHub: https://github.com/jeanette-c * Twitter: https://twitter.com/jeanette_c_s I'm not that innocent... <3 (Britney Spears) 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 |
Date | 2018-06-17 14:26 |
From | John ff |
Subject | Re: [Csnd] Convert cps to MIDI note |
Will add optional rounding. Also will look at mamual improvement.
Sent from Blue
On 17 Jun 2018, at 13:58, "Jeanette C." <julien@mail.upb.de> wrote: Jun 17 2018, jpff has written: |
Date | 2018-06-17 15:04 |
From | jpff |
Subject | Re: [Csnd] Convert cps to MIDI note |
Optional rounding added to ftom in git now. Manual now links from midui convert to ftom and pchtom. Will check the pitch converters when I find the file! On Sun, 17 Jun 2018, Jeanette C. wrote: > Jun 17 2018, jpff has written: > ... >> Perhaps I should spend more time reading the manual.... > ... > Hi John, > honestly, the ftom was rather hidden. At least, it didn't show up under > pitch converters and not in the relevant MIDI section. > > Having the rounding as an optional parameter would be nice, make for > shorter and slightly more elegant code. > > Thanks again for your help, > > Jeanette > > -------- > * Website: http://juliencoder.de - for summer is a state of sound > * SoundCloud: https://soundcloud.com/jeanette_c > * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g > * GitHub: https://github.com/jeanette-c > * Twitter: https://twitter.com/jeanette_c_s > > I'm not that innocent... <3 > (Britney Spears) > > 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 > 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 |
Date | 2018-06-17 18:14 |
From | joachim heintz |
Subject | Re: [Csnd] Convert cps to MIDI note |
yes, the A4 feature came later ... happy to see that this old UDO is not any more needed. i will make a note in the udo file and point to ftom (as well as for https://github.com/csudo/csudo/blob/master/tables/convert/TbToSF.csd which is not any more necessary because of the new ftaudio opcode). cheers - joachim On 16/06/18 19:51, jpff wrote: > Should not that UDO take account of the value of A4? > > On Sat, 16 Jun 2018, luis antunes pena wrote: > >> It would be great if this could turn into an opcode in a future >> version of >> csound ;) >> Best, >> Luis >> >> Am 16.06.18 um 17:05 schrieb Jeanette C.: >> Jun 16 2018, Vincent Michalke has written: >> ... >> https://github.com/csudo/csudo/blob/master/midi/midi.udo >> >> ... >> >> >> -- >> http://luisantunespena.eu >> http://sumtone.com >> 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 >> > > 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 > 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 |
Date | 2018-06-18 20:48 |
From | Tobiah |
Subject | Re: [Csnd] Convert cps to MIDI note |
On 06/16/2018 10:51 AM, jpff wrote: > Should not that UDO take account of the value of A4? What do you mean by the 'value of A4'? > On Sat, 16 Jun 2018, luis antunes pena wrote: > >> It would be great if this could turn into an opcode in a future version of >> csound ;) >> Best, >> Luis >> >> Am 16.06.18 um 17:05 schrieb Jeanette C.: >> Jun 16 2018, Vincent Michalke has written: >> ... >> https://github.com/csudo/csudo/blob/master/midi/midi.udo >> >> ... >> >> >> -- >> http://luisantunespena.eu >> http://sumtone.com >> 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 >> > > 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 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 |
Date | 2018-06-18 21:54 |
From | John ff |
Subject | Re: [Csnd] Convert cps to MIDI note |
There is a variable that may be set in the header that sets the frequency of A4, defaulting to 440 Hz. This allows for working with different reference pitches to match live musicians or styles.
So frequency to MIDI should work related to A4 frequency.
Sent from Blue
On 18 Jun 2018, at 20:49, Tobiah <toby@tobiah.org> wrote: On 06/16/2018 10:51 AM, jpff wrote:Should not that UDO take account of the value of A4? |
Date | 2018-06-19 08:35 |
From | Victor Lazzarini |
Subject | Re: [Csnd] Convert cps to MIDI note |
https://csound.com/docs/manual/A4.html ======================== Prof. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 18 Jun 2018, at 20:48, Tobiah |