ifilcod problem
Date | 2016-10-29 21:49 |
From | Arthur Hunkins |
Subject | ifilcod problem |
The short file below runs fine when beats.wav is in the same directory as this file. When you copy beats.wav to soundin.1, however, and substitute any of the instances of $FILE with the number 1, Csound fails - either with a diskinfo error (the first three instances, or a "can't open soundin.1" error (instance 4). FWIW, I'm on Windows 10, with latest Csound version - but this happens in Csound 5.06 as well. I thought that ifilcod could work with the final digit(s) of a soundin.x file. What am I missing - or is this a (long-standing) bug? <CsoundSynthesizer> <CsOptions> -odac </CsOptions> <CsInstruments> sr = 44100 ksmps = 100 nchnls = 2 #define FILE #"beats.wav"# instr 1 gichan filenchnls $FILE gilen filelen $FILE gipeak filepeak $FILE a1 diskin2 $FILE, 1, 0, 1 outs a1, a1 endin </CsInstruments> <CsScore> i 1 0 6 e </CsScore> </CsoundSynthesizer> Art Hunkins |
Date | 2016-10-30 01:38 |
From | Tarmo Johannes |
Subject | Re: ifilcod problem |
Hardly it helps but can you test to leave the macro out once and test with line: I remember I have used the soundin files and refering them by number without problem.a1 diskin2 1, 1, 0, 1 2016-10-29 17:49 GMT-03:00 Arthur Hunkins <abhunkin@uncg.edu>:
|
Date | 2016-10-30 02:55 |
From | Arthur Hunkins |
Subject | Re: ifilcod problem |
Thanks, Tarmo. Unfortunately, your suggestion still gives me: INIT ERROR in instr 1: diskin2: soundin.1: failed to open file Soundin.1 is clearly present (and a valid soundfile) in the current directory. Art Hunkins On Sat, Oct 29, 2016 at 9:38 PM, Tarmo Johannes <tarmo.johannes@otsakool.edu.ee> wrote:
|
Date | 2016-10-30 08:58 |
From | Victor Lazzarini |
Subject | Re: ifilcod problem |
Is it a case issue? Soundin.1 vs. soundin.1 ======================== Dr 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 30 Oct 2016, at 02:55, Arthur Hunkins |
Date | 2016-10-30 09:25 |
From | Victor Lazzarini |
Subject | Re: ifilcod problem |
Just to say that I tried it on OSX and it works as expected. ======================== Dr 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 30 Oct 2016, at 08:58, Victor Lazzarini |
Date | 2016-11-04 18:39 |
From | jpff |
Subject | Re: ifilcod problem |
Did this get resolved? On Sat, 29 Oct 2016, Arthur Hunkins wrote: > The short file below runs fine when beats.wav is in the same directory as this > file. > > When you copy beats.wav to soundin.1, however, and substitute any of the > instances of $FILE with the number 1, Csound fails - either with a diskinfo > error (the first three instances, or a "can't open soundin.1" error (instance > 4). > > FWIW, I'm on Windows 10, with latest Csound version - but this happens in > Csound 5.06 as well. > > I thought that ifilcod could work with the final digit(s) of a soundin.x file. > > What am I missing - or is this a (long-standing) bug? > > > |
Date | 2016-11-05 18:41 |
From | Arthur Hunkins |
Subject | Re: ifilcod problem |
Thanks for asking, John. No, it hasn't. I continue to work on it, and would appreciate further suggestions. It is part of a larger problem - also unsolved - of trying to work with soundfile names, either as strings or via soundin.x. Basically, within an Android Csound .csd, I want a user to press a button to select a specific soundfile (among 7 available) to use as the input to diskin2. Chnget is the vehicle, but I can't seem to find a way to get the correct k-time-selected .wav filename to be accepted by diskin2. (The file is played in a separate instrument driven by the event opcode.) If the simple example I sent would work for me, I think I could also get the larger issue solved. Art Hunkins On Fri, Nov 4, 2016 at 2:39 PM, jpff <jpff@codemist.co.uk> wrote: Did this get resolved? |
Date | 2016-11-05 18:48 |
From | Steven Yi |
Subject | Re: ifilcod problem |
Hi Art, Could you comment on Victor's question: "Is it a case issue? Soundin.1 vs. soundin.1" steven On Sat, Nov 5, 2016 at 2:41 PM, Arthur Hunkins |
Date | 2016-11-05 18:49 |
From | Arthur Hunkins |
Subject | Re: ifilcod problem |
No, it's not. Art Hunkins On Sat, Nov 5, 2016 at 2:48 PM, Steven Yi <stevenyi@gmail.com> wrote: Hi Art, |
Date | 2016-11-05 18:57 |
From | Steven Yi |
Subject | Re: ifilcod problem |
Okay, good to know. Just FYI, I gave your original CSD a test here, copying beats.wav to soundin.1, then redefining FILE to: #define FILE #1# and I got: new alloc for instr 1: diskin2: opened 'soundin.1': 44100 Hz, 1 channel(s), 88200 sample frames which played fine. I am also on Windows 10, but I am using a personal build with the latest from GIT. On Sat, Nov 5, 2016 at 2:49 PM, Arthur Hunkins |
Date | 2016-11-05 19:32 |
From | John ff |
Subject | Re: ifilcod problem |
Could it be search paths? FWIW it worked on GNU/Linux
Sent from TypeApp
On 5 Nov 2016, at 18:50, Arthur Hunkins <abhunkin@UNCG.EDU> wrote:
|
Date | 2016-11-05 19:36 |
From | John ff |
Subject | Re: ifilcod problem |
Another thought... what happens if you set FILE to "soundin.1". ?
Sent from TypeApp
On 5 Nov 2016, at 18:58, Steven Yi <stevenyi@GMAIL.COM> wrote: Okay, good to know. Just FYI, I gave your original CSD a test here, |
Date | 2016-11-05 21:34 |
From | Arthur Hunkins |
Subject | Re: ifilcod problem |
Doesn't work - same error messages. Art Hunkins On Sat, Nov 5, 2016 at 3:36 PM, John ff <jpff@codemist.co.uk> wrote:
|
Date | 2016-11-05 21:36 |
From | Steven Yi |
Subject | Re: ifilcod problem |
Could you post the exact CSD you're using to test? On Sat, Nov 5, 2016 at 5:34 PM, Arthur Hunkins |
Date | 2016-11-05 21:41 |
From | jpff |
Subject | Re: ifilcod problem |
If you get te same error ten either the fie does not exist or nameis mistype, or it is lookup pats. Please cnfim that beats.wav and soundin.2 are in the same directory/folder and there ae no additional characters in the name. an exercise in straws and slutching from me.... On Sat, 5 Nov 2016, Arthur Hunkins wrote: > Doesn't work - same error messages. > > Art Hunkinshttp://www.arthunkins.com > > On Sat, Nov 5, 2016 at 3:36 PM, John ff |
Date | 2016-11-05 21:52 |
From | Tarmo Johannes |
Subject | Re: ifilcod problem |
Hi, Do I understand you correct that this is on Android? Where are the files stored? Are you using Csound for Android App or building your own? In the latter case it might be a permission issue - on Android you mostly need to copy your files from the assets to a temporary file befre you can access it. Just shooting in the dark... And: if you set the full path of the soundfile in diskin command, does it work then? tarmo On Saturday 05 November 2016 14:41:34 you wrote: > Thanks for asking, John. > > No, it hasn't. I continue to work on it, and would appreciate further > suggestions. > > It is part of a larger problem - also unsolved - of trying to work with > soundfile names, either as strings or via soundin.x. Basically, within an > Android Csound .csd, I want a user to press a button to select a specific > soundfile (among 7 available) to use as the input to diskin2. Chnget is the > vehicle, but I can't seem to find a way to get the correct k-time-selected > .wav filename to be accepted by diskin2. (The file is played in a separate > instrument driven by the event opcode.) > > If the simple example I sent would work for me, I think I could also get > the larger issue solved. > > > Art Hunkins > http://www.arthunkins.com > > On Fri, Nov 4, 2016 at 2:39 PM, jpff |
Date | 2016-11-05 22:01 |
From | Arthur Hunkins |
Subject | Re: ifilcod problem |
Steven - I'm at a loss. I get the same errors in your case as before - both in Windows 10 and Android. The .csd simply can't fine my soundfile - even though they are always in the same (and current) directory. The *only* version I've gotten to work (with my basic .csd) is: #define FILE #"beats.wav"# (It works for me both in Windows 10 and Android. Art Hunkins On Sat, Nov 5, 2016 at 2:57 PM, Steven Yi <stevenyi@gmail.com> wrote: Okay, good to know. Just FYI, I gave your original CSD a test here, |
Date | 2016-11-05 22:03 |
From | Steven Yi |
Subject | Re: ifilcod problem |
Could you zip up the soundin.1 and CSD file and place it somewhere? I asked for the test CSD so that we can test the exact file in case we're typing something differently. On Sat, Nov 5, 2016 at 6:01 PM, Arthur Hunkins |
Date | 2016-11-05 22:06 |
From | Tarmo Johannes |
Subject | Re: ifilcod problem |
Not a solution but perhaps a workaround - you could use directory opcode and put the filenames into an array and use them by index: gSFiles[] directory " |
Date | 2016-11-05 22:25 |
From | Arthur Hunkins |
Subject | Re: ifilcod problem |
Attachments | 1Email.zip |
Attached is a zip archive of my basic .csd, with FILE defined as 1. My soundin.1 wav file is a renamed beats.wav. As it stands the .csd doesn't run without errors. With an actual beats.wav file, and FILE defined as beats.wav, all is fine. Art Hunkins On Sat, Nov 5, 2016 at 6:03 PM, Steven Yi <stevenyi@gmail.com> wrote: Could you zip up the soundin.1 and CSD file and place it somewhere? |
Date | 2016-11-05 22:30 |
From | Tarmo Johannes |
Subject | Re: ifilcod problem |
Hi, have not tired yet but I already see - the soundfile in you zip has name "soundin.1.wav" - see the .wav? I think it is the witty Windows that does not show file extensions that caused this problem. I don't know but can you rename the file somehow in command propt so that the window manager does not put its hands in between? tarmo On Saturday 05 November 2016 18:25:44 you wrote: > Attached is a zip archive of my basic .csd, with FILE defined as 1. My > soundin.1 wav file is a renamed beats.wav. > > As it stands the .csd doesn't run without errors. With an actual beats.wav > file, and FILE defined as beats.wav, all is fine. > > Art Hunkins > http://www.arthunkins.com > > On Sat, Nov 5, 2016 at 6:03 PM, Steven Yi |
Date | 2016-11-05 22:31 |
From | Arthur Hunkins |
Subject | Re: ifilcod problem |
I'm beginning to wonder if there's not some kind of path issue too. Somehow, the regularly named "beats.wav" is found when in the current directory, whereas the same file renamed soundin.1 in the current directory is not - when referred to either as #1# or #"soundin.1"#. But how could this be? Art Hunkins On Sat, Nov 5, 2016 at 5:41 PM, jpff <jpff@codemist.co.uk> wrote: If you get te same error ten either the fie does not exist or nameis mistype, or it is lookup pats. |
Date | 2016-11-05 22:37 |
From | Arthur Hunkins |
Subject | Re: ifilcod problem |
Do I understand you correct that this is on Android? Yes - Android and Windows 10 Where are the files stored? In the same directory as the .csd. Are you using Csound for Android App or building your own? Csound for Android app (the latest) I haven't tried with a complete pathname, but the simple filename in the FILE macro works fine - just working with soundin.x does not. Art Hunkins On Sat, Nov 5, 2016 at 5:52 PM, Tarmo Johannes <tarmo.johannes@otsakool.edu.ee> wrote: Hi, |
Date | 2016-11-05 22:41 |
From | Arthur Hunkins |
Subject | Re: ifilcod problem |
I may try this if nothing else works. I've been wondering about indexing a table composed of strings as well (I think this is possible. Istvan added a number of string-related opcodes) Art Hunkins On Sat, Nov 5, 2016 at 6:06 PM, Tarmo Johannes <tarmo.johannes@otsakool.edu.ee> wrote: Not a solution but perhaps a workaround - |
Date | 2016-11-05 22:51 |
From | Arthur Hunkins |
Subject | Re: ifilcod problem |
Yes - this may well be the issue; I'll explore. I noticed this recently in passing as well. Also, Android doesn't show any .wav extension either. Wonder what the best way to get rid of the problem/extension is? Even the csound console output doesn't show the .wav extension. Another issue for me is that I invite users to substitute/add their own .wav loops. (I really can't expect them to need to deal with such an issue. So maybe I'll need to deal only with ordinary .wav files - no soundin.x. In which case I'm back to dealing with strings.) Art Hunkins On Sat, Nov 5, 2016 at 6:30 PM, Tarmo Johannes <tarmo.johannes@otsakool.edu.ee> wrote: Hi, |
Date | 2016-11-05 23:05 |
From | Steven Yi |
Subject | Re: ifilcod problem |
The issue is as Tarmo mentioned. The file should be named "soundin.1" and not "soundin.1.wav". Trying to render the CSD as-is gives an error, but renaming the audio file to "soundin.1" works. On Sat, Nov 5, 2016 at 6:51 PM, Arthur Hunkins |
Date | 2016-11-05 23:11 |
From | Arthur Hunkins |
Subject | Re: ifilcod problem |
Wonderful! Problem solved! Thanks much, Tarmo. (And all others for taking the time to explore this issue with me.) All I needed to do was, under View in Windows, to check Display Extensions - then I could rename a soundin.x file without the added .wav. I got into this problem by simply copying/pasting a regular .wav, and renaming it to soundin.x without realizing that the .wav carried over. Without View Extensions turned on I didn't usually see .wav displayed. Again, thanks; onward and ..... Art Hunkins On Sat, Nov 5, 2016 at 6:30 PM, Tarmo Johannes <tarmo.johannes@otsakool.edu.ee> wrote: Hi, |
Date | 2016-11-05 23:17 |
From | Arthur Hunkins |
Subject | Re: ifilcod problem |
Understood, Steven - and thanks for your willingness to pursue this with me. (This issue has occupied me for weeks actually.) Now on to my larger issue of the user selecting files with buttons in my Android .csd. Maybe now I can deal with numerical filecodes instead of filename strings and macros. Art Hunkins On Sat, Nov 5, 2016 at 7:05 PM, Steven Yi <stevenyi@gmail.com> wrote: The issue is as Tarmo mentioned. The file should be named "soundin.1" |