[Csnd] Question re log opcode error using base
Date | 2023-11-04 01:45 |
From | Scott Daughtrey |
Subject | [Csnd] Question re log opcode error using base |
The manual suggests the log opcode has an optional arbitrary ibas parameter when using arrays: log — Returns a natural log of a number, or an array (with optional arbitrary base) kout[]log kin[],ibas https://csound.com/docs/manual/log.html When attempting to use the ibas parameter it results in an error: Unable to find opcode entry for 'log' with matching arguement types. Found: k log ki instr 1 kVal[] fillarray 27 kLog[] init 1 iBase = 3 kLog[0] log kVal[0], iBase printk 1, kLog[0] endin Can anyone suggest where the syntax is incorrect in this code? Using a kBase doesn't work either (error k log kk). Best, Scott 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 | 2023-11-04 10:31 |
From | Victor Lazzarini |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Question re log opcode error using base |
I don’t see this opcode anywhere in the system, I’ve only seen log() with 1 argument (for any rate and for i/k arrays). I’ve implemented the array version but I don’t remember doing the 2 argument version. The source code only contains the 1 input version. You will need to convert from the required base to either log, log2 or log10. John’s name is in the docs so maybe he has more ideas about this. ======================== Prof. Victor Lazzarini Maynooth University Ireland > On 4 Nov 2023, at 01:45, Scott Daughtrey |
Date | 2023-11-04 10:38 |
From | "Jeanette C." |
Subject | Re: [Csnd] Question re log opcode error using base |
Hi Scott, it's just an idea, but in your code you used something like: kLog[0] log kArray[0], iBase But you said that the iBase arguments is for arrays only, so it should read: kLog log kArray, iBase No indices, because then the opcode will not see arrays, but one k-rate signal. HTH. Best wishes, Jeanette -- * Website: http://juliencoder.de - for summer is a state of sound * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g * Audiobombs: https://www.audiobombs.com/users/jeanette_c * GitHub: https://github.com/jeanette-c I thought love was just a tingling of the skin <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 | 2023-11-04 13:46 |
From | Victor Lazzarini |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Question re log opcode error using base |
There is now an opcode like that in Csound 7 (develop branch). ======================== Prof. Victor Lazzarini Maynooth University Ireland > On 4 Nov 2023, at 10:31, Victor Lazzarini |
Date | 2023-11-04 18:10 |
From | ST Music |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Question re log opcode error using base |
Thanks Jeanette! That works for me. So basically it works on the whole array, not just individual indices. The manual description seems a little misleading, or perhaps I'm just a bit dimwitted ;) However, with most other array opcodes it's defined in the manual, such as maparray: karray maparray kinarray, String So it's a little unusual that log uses the array symbols: kout[]log kin[][,ibas] Anyways, this works great now: instr 1 kVal[] fillarray, 9, 27, 81 kLog[] init 3 iBase = 3 kLog log kVal, iBase printk 1, kLog[1] printarray kLog, metro(1) endin Thanks again for your help =) Best, Scott On Sat, Nov 4, 2023, 9:46 a.m. Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote: There is now an opcode like that in Csound 7 (develop branch). |
Date | 2023-11-04 18:17 |
From | ST Music |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Question re log opcode error using base |
Thanks Victor, fortunately problem solved (user error =)). Best, Scott On Sat, Nov 4, 2023, 9:46 a.m. Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote: There is now an opcode like that in Csound 7 (develop branch). |
Date | 2023-11-04 18:53 |
From | "Jeanette C." |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Question re log opcode error using base |
Hi Scott, oh a few opcodes use the [] symbols to mark arrays, but mostly when an array is a choice: For example linlin: https://csound.com/manual/linlin.html And others. A few random number generators, I think, other matyhematical functions, if one needs them. Though with basic maths working with direct operators probably looks more straightforward. Best wishes, Jeanette -- * Website: http://juliencoder.de - for summer is a state of sound * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g * Audiobombs: https://www.audiobombs.com/users/jeanette_c * GitHub: https://github.com/jeanette-c Do you even know what I like Just what I'm living for, What I adore <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 | 2023-11-05 01:37 |
From | Victor Lazzarini |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Question re log opcode error using base |
Thanks. Which version were you using? Prof. Victor Lazzarini
Maynooth University
Ireland
On 4 Nov 2023, at 18:18, ST Music <stunes6556@gmail.com> wrote:
|
Date | 2023-11-05 01:39 |
From | ST Music |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Question re log opcode error using base |
Csound for Android ver 39 with library ver 6.18. The recent update M Gogins released. On Sat, Nov 4, 2023, 9:37 p.m. Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
|
Date | 2023-11-05 01:56 |
From | Victor Lazzarini |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Question re log opcode error using base |
Thks Prof. Victor Lazzarini
Maynooth University
Ireland
On 5 Nov 2023, at 01:40, ST Music <stunes6556@gmail.com> wrote:
|
Date | 2023-11-05 02:18 |
From | Victor Lazzarini |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] Question re log opcode error using base |
I see now; there was no such opcode for i-time arrays (only for k-rate) and that was what tripped me. Now I’ve added the i-time version to Csound 7.0 only (and removed the k-rate duplicate I had committed). ======================== Prof. Victor Lazzarini Maynooth University Ireland > On 4 Nov 2023, at 18:10, ST Music |