| Hi Steven and all,
Although it's true that embedding binary data is somewhat impractical
for audio files and such, I do very much like and appreciate the work
developers have put into making the csb64enc utility and the associated
embedded media possibilities within Csound and sincerely hope that they
will remain a part of the language.
Take this example[1], IMHO it makes more sense to use embedded media
specifically for performance information. Another possibility I've
found useful for the csb64enc utility is to write simple C programs
(much like the Python script Steven provided as a test for the
logcurve/expcurve opcodes) which is output to a text file and then used
as embedded media to load into GEN23.
Related to the topic at hand, one problem I've noticed with the
embedded media is that if you put embedded media into your .csd file
and the embedded media's "expanded name" is already taken by a file in
the directory, the compilation fails when it really shouldn't - as
nothing is wrong with the .csd. I think that the optimal behaviour
would append numbers to the embedded media by default to avoid name
conflicts but I'm not sure how this would be implemented.
To reiterate, I certainly agree that putting multiple audio files like
drum loops into a .csd as embedded media is sluggish and a bit of a
pain at times (50 mb text file??) but there are certainly advantages
and I can only see this feature growing as the technology available
improves.
-David
[1]
5.01 or later
; Realtime flags, only tested on Mac OS X
;-odac:1 -iadc:1 -b1024 -B1024 -d -Finv10.mid -T -+rtaudio=coreaudio
-+rtmidi=null
; Offline render flags, only tested on Mac OS X
;-o/Volumes/Neuromancer/TEMP/bach_inv10-GMaj.aif -Finv10.mid -T -K -A
-R -+rtmidi=null
; Invention #10 in G Major by J.S. Bach
; also demonstrates use of embedded media in a .csd file
sr = 44100
kr = 441
ksmps = 100
nchnls = 2
massign 1, 1
massign 2, 2
gal init 0
gar init 0
itmp ftgen 1, 0, 16384, 10, 1, 0, 1/3, 0, 1/5, 0, 1/7, 0, 1/9, 0,\
1/11, 0, 1/13, 0, 1/15, 0, 1/17, 0, 1/19
itmp ftgen 2, 0, 16384, 10, 1/1, 1/2, 1/3, 1/4, 1/5, 1/6, 1/7, 1/8,\
1/9, 1/10, 1/11, 1/12, 1/13, 1/14, 1/15, 1/16
/*--- ---*/
instr 1 ; right hand
iamp ampmidi 4200
kcps cpsmidib 0
a1 oscil iamp, kcps+0.002, 1
a2 oscil iamp, kcps-0.002, 1
aenv linenr 1, 0.05, 0.05, 0.05
aout = (a1+a2)*aenv
a0ut moogvcf aout, iamp, 0.707, 0dbfs
anul = 0
outs a0ut, anul
gal = gal + a0ut
endin
/*--- ---*/
instr 2 ; left hand
iamp ampmidi 4200
kcps cpsmidib 0
a1 oscil iamp, kcps+0.002, 2
a2 oscil iamp, kcps-0.002, 2
aenv linenr 1, 0.05, 0.05, 0.05
aout = (a1+a2)*aenv
anul = 0
outs anul, aout
gar = gar + aout
endin
/*--- ---*/
instr 25
al = gal/1.618
ar = gar/1.618
aoutl, aoutr reverbsc al, ar, 0.618, sr/2
outs aoutl, aoutr
gal = 0
gar = 0
endin
/*--- ---*/
i25 0 360
e
TVRoZAAAAAYAAQADAeBNVHJrAAAAIwD/AwxNYXN0ZXIgVHJhY2sA/1EDBJ+2AP9YBAkDGAgA
/y8ATVRyawAACEAA/wMETUlESQD/AQJSSACQQ0CBcEMAAEdAgXBHAABKQIFwSgAAR0CBcEcA
AENAgXBDAABKQIFwSgAAR0CBcEcAAENAgXBDAABPQIFwTwAATkB4TgAATzh4TwAATkCBcE4A
AEpAgXBKAABRQIFwUQAATkCBcE4AAEpAgXBKAABRQIFwUQAATkCBcE4AAEpAgXBKAABPQIFw
TwAASkCBcEoAAEdAgXBHAABNQIFwTQAASkCBcEoAAEdAgXBHAABNQIFwTQAASkCBcEoAAEdA
gXBHAABMQIFwTAAASECBcEgAAEVAgXBFAABCQIFwQgAARUCBcEUAAEhAgXBIAABMQIFwTAAA
SkCBcEoAAEhAgXBIAABKQIFwSgAAR0CBcEcAAENAgXBDAABAQIFwQAAAQ0CBcEMAAEdAgXBH
AABKQIFwSgAASECBcEgAAEdAgXBHAABIQIFwSAAARUCBcEUAAEJAgXBCAAA+QIFwPgAAQkCB
cEIAAEVAgXBFAABIQIFwSAAAR0CBcEcAAEVAgXBFAABHQIFwRwAASECBcEgAAEpAgXBKAABM
QIFwTAAAR0CBcEcAAE9AgXBPAABMQIFwTAAAR0CBcEcAAE9AgXBPAABFQIFwRQ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cDIAADBAgXAwAAAvQIFwLwAAOUCB
cDkAAC9AgXAvAAArQIFwKwAAL0CBcC8AADJAgXAyAAAvQIFwLwAAK0CBcCsAADJAgXAyAAAv
QIFwLwAAK0CBcCsAACpAgXAqAAAmQIFwJgAAKkCBcCoAAC1AgXAtAAAqQIFwKgAAJkCBcCYA
AC1AgXAtAAAqQIFwKgAAJkCBcCYAACtAgXArAAAtQIFwLQAAL0CBcC8AAC1AgXAtAAAvQIFw
LwAAMECBcDAAAC9AgXAvAAAwQIFwMAAAMkCBcDIAAChAh0AoAIFwNECBcDQAADZAgXA2AAA0
QIFwNAAAMkCBcDIAADdAeDcAADZAeDYAADdAgXA3AAAvQIFwLwAANECBcDQAADJAgXAyAAAw
QIFwMAAAMkB4MgAAMEB4MAAAMkCBcDIAACZAgXAmAAArQIdAKwAAL0CBcC8AADJAgXAyAAA3
QIg4NwAA/y8A
On Oct 20, 2006, at 12:57 AM, Steven Yi wrote:
> Hi Anthony,
>
> I was never fond of the idea of embedding binary data in CSD files as
> I never understood what anyone gained from it. If I want to study a
> CSD that has lots of binary files embedded in it, it's only going to
> slow down a text editor to open. I'd much prefer files be zipped up as
> a package separately than to have one gigantic text file so I can see
> what files are included rather than try to intuit that by reading the
> CSD. It's also easier to test and debug a CSD when you can check the
> individual parts. The only thing is packaging everything, but it
> seems like such a small positive to me compared to all of the
> negatives (IMO).
>
> steven
>
>
> On 10/20/06, Anthony Kozar wrote:
>> The functionality appears to have been around since at least Csound
>> 4.07 but
>> hardly anyone seems to know about it (and I have never seen anyone
>> _use_ it
>> except for development & testing).
>>
>> The tag can be used to embed any type of file into a .CSD
>> file --
>> orchestra includes, midi files, audio files, analysis files, etc.
>> Probably
>> the reason it has never really been used though is that the file has
>> to be
>> encoded using "Base64 encoding." This is simply a way of turning any
>> binary
>> (or text) file into a text-only format. Base64 is a standard way of
>> sending
>> email attachments because email only really allows text.
>>
>> Csound has been able to read Base64-encoded files for a long time but
>> only
>> with version 5.00 did it start to include two standard utilities
>> (written by
>> Istvan Varga) for performing base64 encoding and for wrapping
>> everything up
>> nicely with a bow in a .CSD file for you.
>>
>> is described here:
>>
>> http://csounds.com/manual/html/CommandUnifileFormat.html#id2861206
>>
>> The makecsd utility will do both the base64 encoding and the CSD
>> construction for you and is described here:
>>
>> http://csounds.com/manual/html/makecsd.html
>>
>> I do not know for certain which Csound 5 distributions actually
>> include this
>> utility -- I hope that they all do.
>>
>> I can send you an example CSD from Istvan if you wish.
>>
>> Anthony Kozar
>> anthonykozar AT sbcglobal DOT net
>>
>>
>> Art Hunkins wrote on 10/19/06 4:36 PM:
>>
>>> OK, this is a new one for me:
>>>
>>>> You can embed your samples and all other needed
>>>> files directly into a CSD and let Csound automagically handle
>>>> extracting
>>>> them and finding them. There has not been a need to set any
>>>> environment
>>>> variables or to cd to the right directory under these circumstances
>>>> for a
>>>> long time.
>>>
>>> Please point me to information on how to do this. A search of the
>>> Csound
>>> help file doesn't turn up anything for "embed" or "samples." This is
>>> how I
>>> should probably distribute my composition that uses samples ("What's
>>> in a
>>> Name?").
>>>
>>> Art Hunkins
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |