Hi all,
taking as a reference the patch by Tolga Tüzün shown on page 269 of The OM Composers’s Book 2, does anybody have any idea about how to reconstruct it or to build something similar that can yield to the same results, i. e. writing the 1TRC partials in a bpf-lib? Many thanks for your kind attention.
Best regards,
Francesco Vitale
Hi,
I don’t know about the patch on page 269 but may be the file attached could help ? I for one think that you have to dig the sdif properties (read and write) and use some sampling and scaling to deal with the data ?
Bye
N.
partials_to_bpf.omp (486 KB)
Many thanks Nadir for your reply. Actually, the algorithm I’m talking about does something rather specific, that does not consists of merely extracting the data (there are many ways to read a SDIF). The thing that comes closer to the patch in the aforementioned book is this code to be found in the utilities of the brilliant OMPursuit library by M. Schumacher:
(defmethod! partials->bpflib ((self sdiffile) &key mintime maxtime) ;(frametype “1TRC”))
:icon '(141)
:numouts 1
(multiple-value-bind (framelist timelist) (getsdifdata self 0 “1TRC” “1TRC” nil nil nil mintime maxtime)
(setf partial-list (loop for frame in framelist
for time in timelist collect
(loop for partial in frame collect
(x-append partial time))
)))
(setf grouped-partials (group-indices (flat partial-list 1)))
(loop for partial in grouped-partials collect
(let ((thepartial (mat-trans (cdr partial))))
(simple-bpf-from-list (fourth thepartial) (first thepartial) 'bpf 10)
)))
But when I try to use it, I get this message: Error while evaluating the box PARTIALS->BPFLIB : Undefined operator group-indices in form (group-indices (flat partial-list 1)). Honestly, I do not know how to correct the code in the right way, so, dear Marlon, where art thou?
Hi Francesco,
It seems that you have a missing function or method : grouped-indices. Without it you cannot use partials->bpflib method. Did you load marlon’s library ? the method is in it i just checked.
Best
K
Dear Karim,
I didn’t load the library because it causes many conflicts with the other ones. Could you please tell me where’s the grouped-indices method, so I can add it to the code? I was looking for it in vain in the version of OMPursiut that I have… Many thanks
Francesco
It’s in the utilities.lisp file in sources. Here it is :
(defmethod! group-indices ((self list))
(let ((reslist nil))
(loop for item in self do
(let ((position (position (car item) reslist :test '= :key 'car)))
(if position
(pushr (cdr item) (nth position reslist))
(pushr (list (car item) (cdr item)) reslist))))
(mapcar 'identity reslist)))
But hope there are no dependencies. Tell me if you encounter one.
And for all of you sorry for the multiple msgs it seems that forumnet fails to update correctly ehn i send a msg.
Best yto u all.
K
Thanks Karim! Apparently I deleted that method when fiddling with the utilities.lisp. However, what does your bpf-lib output look like when you evaluate the partials->bpflib box? Here’s how it looks mine, and the result is quite unconvincing…
Francesco
Hi,
The function seems to work properly here (see screenshots).
M
Hi Marlon,
here’s the lisp code that I put in the patches folder of OM. If you use that .lisp file (instead of loading the entire OMPursuit library), do you still get the right bpf-lib (the one shown in your screenshots)? Maybe there are some other dependencies that I haven’t included in the .lisp file that you know are important. Can you tell if there’s something missing in there? Thanks for your reply.
Best,
Francesco
partialstobpflib.lisp (1.15 KB)
Hi Francesco,
can you also send the sdif file along. It may be the reason why it displays so.
Thx
K
Cheers Everyone,
Francesco, I’ve attached a patch which relies only on OM’s standard libraries, see if it works for you.
And I confirm Marlon’s comment, OM-Pursuit’s “partials->bpflib” function works fine on my end too.
Hope this helps.
All the best,
António
trc-2-bpflib.omp (104 KB)
Dear Francesco,
It works for me (c.f attachment) with your lisp code. I suspect it is your sdif file. It should be a 1TRC.
@Antonio, your patch however doesn’t work for my sdif file. I beleive it has some limitations (?)
Best to you all .
K
Dear Karim,
I confirm that unfortunately António’s patch does not work for me (either on 10.6.8 and on El Capitan). Here’s the 1TRC sdif.
Best to all,
Francesco
chord.zip (58.2 KB)
Dear Francesco,
Ok i tried your sdif. It gives me the same result as you have. I imagine it is just a burst of a chord?
That’s why you get this column. It’s a very very short burst. try with something more resonant.
Best
K
Dear Karim,
I don’t know why, but the forum keeps messing with my posts and attachments, so that my replies appear multiple times in the right column of the home page, and the attachments are always duplicated. The corresponding sound of the sdif I gave you is in fact “resonant” (it lasts over two seconds), you can check that by loading it in AS. I suspect that the problem comes from the fact that the sdif has been produced with SPEAR, and not with PM2. The reason why Marlon’s algorithm does not work for the SPEAR 1TRC files remains for me a mystery.
Best,
Francesco
Ok, I think I found what the issue was, and now Marlon’s lisp code works for me (as you can see from the screen capture): the sdif produced by SPEAR must be saved with the “exact interpolated” option, and NOT with the “resampled frames” option. Still, the reason why the “resampled frames” sdif does not work with Marlon’s code remains to me obscure. Thanks for your attention.
Best,
Francesco
Great !
A propos the double trouble of the posts i have reported them. It is really messy !
Best
K
Francesco, Karim, I’ve corrected the patch. I’ve tried it on Francesco’s sdiffile and a few of my own, and it seems to be working fine.
Best,
António
trc-2-bpflib2.omp (436 KB)
Dear António,
I’m very thankful for your efforts. On my computers (macbook, imac), with different types of Mac OS, the message I get when evaluating is unluckily still the same as before: “Error while evaluating the box 1 : The variable #:g2516188 is unbound”. Maybe there’s something else to be debugged in the patch you kindly gave us.
All the best,
Francesco
I’m sorry to hear that, Francesco, because it’s working fine on my end. I’m on OM 6.8 and I don’t have .9 or .10 to further test it or debug it for those versions of O.M…
Best,
António