Re: [Qutecsound-devel] how to include files in example
Brought to you by:
mantaraya36
From: Tarmo J. <tar...@ot...> - 2021-07-30 11:35:34
|
Yes, I agree it makes sense to rework it. On MacOs and Windows with the installers it is no problem, on Linux we must make sure that the examples can be found, perhaps there should be an option in the configuration. Greetings, Tarmo R, 30. juuli 2021 13:43 joachim heintz <jh...@jo...> kirjutas: > thanks for the reply, tarmo! > > the inclusion of sound files into some of the csd examples is not only > an issue for ImitativeAdditive.csd. there are a couple of other > examples which i would like to change, too. so moving the examples to > another category is no solution. > > after your explanation i have two ideas: > > 1. would it be possible (and not too hard) to treat the current > /examples in the same way as src/Examples? this means that they are not > compiled, but just copied. i think this is actually also better because > then the users can access the csd files. and we could add the sound > files in a similar way i did it with the floss manual examples. > i think this would be the best solution. > > 2. if not possible, the method you described should be allright: > "Thus the fox.wav added this way should be copied (by Qt) to a temporary > location first and the path should be given to Csound via --env:SSDIR+= > or setting environment variable." > > let me know what you think; cheers - > > joachim > > > On 30/07/2021 11:34, Tarmo Johannes wrote: > > Hi! > > > > Sorry, I did see your email but waited for a good moment to try it out. > > I did not yet but for now I can explain the background: > > > > there are two places for examples - <CsoundQt source folder>/examples > > and and <source>/src/Examples > > > > The first gets compiled as binary code to CsoundQt as Qt resource, the > > second, the "extended examples" (Floss, McCurdy, Stria) gets installed > > to the system as normal folders. > > > > The problem is that Qt can read from the compiled-in resource but Csound > > not. Thus the fox.wav added this way should be copied (by Qt) to a > > temporary location first and the path should be given to Csound via > > --env:SSDIR+= or setting environment variable. Quite some hassle. > > > > One solution is to add the material to the end of csd with the <CsFileB > > filename="fox.wav"></CsFileB> (I forgot which tool helps to do it) (like > > in case of Synths/Scanned_Synthes_Sandbox.csd) > > but anyway - I think at some point Andés and René discussed it and > > decided that no large source materials are added to src/examples - it > > makes just the CsoundQt binary grow. > > > > Much simpler way would be to put ImitiativeAdditive.csd into the real > > folder under "src/Examples" where fox.wav is is in > > src/Examples/FLOSS Manual Examples/SourceMaterials/ and set the SSDIR > > relative to the csd. Perhaps it makes sense to do another folder like: > > > > src/Examples/Other (please think about a good name) and then > > --env:SSDIR+=../FLOSS Manual Examples/SourceMaterials > > should work. > > > > I am not sure at the moment if the Examples menu gets populated > > automatically or we need to create another entry. in the code. > > > > Please let me know what you think and if I can help somehow? > > > > tarmo > > > > Kontakt joachim heintz (<jh...@jo... > > <mailto:jh...@jo...>>) kirjutas kuupäeval R, 30. juuli 2021 > kell > > 10:31: > > > > hi tarmo, hi eduardo - > > > > i wrote an email to the csoundqt dev list. think this would be > > great to > > include in csoundqt 1.0.0. can you help? the text below. > > > > i want to include "fox.wav" in > Examples/Synths/ImitiativeAdditive.csd. > > > > what is the best way to achieve this? > > > > in the McCurdy and FLOSS examples, i once inserted the option: > > --env:SSDIR+=../SourceMaterials > > > > i tried the same here (locally, no push to git): > > 1. i created a folder "SourceMaterials" in the examples/ directory, > > with > > fox.wav in it. > > 2. i inserted this around line 4600 in src/qutecsound.cpp: > > QStringList sourceMaterials; > > sourceMaterials << ":/examples/SourceMaterials/fox.wav"; > > subMenus << sourceMaterials; > > subMenuNames << tr("SourceMaterials"); > > 3. and in application.qrc: > > <file>../examples/SourceMaterials/fox.wav</file> > > > > after recompiling, the folder "SourceMaterials" shows up in the menu, > > but the fox.wav is not found by csound. > > > > perhaps i forgot one step? > > > > but anyway, i think it is a nasty way to do it. so back to the > > question > > above: how can it be done better, properly? > > > > cheers - > > joachim > > > |