« Return to Thread: PyRTCmix on github
For PyRTcmix I am actually generating a C++ object, I think, in the end. It's basically a mirror of the imbedded system.If it's just a matter of passing around pointers i don't think it'd be a problem._______________________________________________
Blaine
On Mon, Oct 3, 2011 at 5:37 PM, John Gibson <johgibso@...> wrote:Since this works with PYCMIX, doesn't that mean it could work with PyRTCmix? Python extensions can be C++.
J
On Oct 3, 2011, at 5:30 PM, Brad Garton wrote:
> That's the problem -- I'm not sure it's easy to get to work in C. I haven't looked closely at it, since I started importing the entire parsing language into the imbedded environment. Essentially the handle would have to be passed out to the python level, and then used as an argument for the rrr.cmd() function.
>
> brad
>
>
> On Oct 3, 2011, at 4:50 PM, Blaine wrote:
>
>> Thanks Brad!
>>
>> Do you have an example (in C) on a typical use case? Was Marcus' problem related to makegen or PField? If it's easy to get to work in C, it should work in python.
>>
>> Blaine
>>
>>
>> On Mon, Oct 3, 2011 at 4:44 PM, Brad Garton <garton@...> wrote:
>> Blaine --
>>
>> This looks really fine! One thing (and I don't know Python at all) -- I wonder if there is a way to get Python to deal with PField-handle variables. Marcus Bittencourt ran into this problem with a large C project he's been using... the old makegen() system is kind of creaky and may not work properly in all circumstances.
>>
>> brad
>>
>>
>> On Oct 3, 2011, at 4:41 PM, Blaine wrote:
>>
>>> Hi everyone. I took some time today to make sure that PyRTCmix could get all packaged up and in one place. Check it out here: https://github.com/booherbg/PyRTcmix Download the tarball, clone it with git, or fork it in github. It's up to you :) It'd be nice to get feedback.
>>>
>>> A few options:
>>> Want to start fresh? Just run install_everything.sh and make sure you have the following packages installed: python-dev python-setuptools and cython. This script (peek at it if you want to do it yourself) will download the rtcmix daily snapshot, patch it up so PyRTcmix can use it, configure & compile, and compile & install my extension, permissions willing.
>>>
>>> You don't *need* to have cython and/or setuptools (both are python tools), but you have to be comfortable editing a makefile. You only really need cython if you want to re-generate the .cpp file from the .pyx file but it's an easy install with apt-get.
>>>
>>> See the INSTALL and README for more information. I haven't tested this on anything other than my ubuntu laptop, so YMMV. Also I have a strange buffer issue where sometimes the sound is garbled. I am curious if anyone else has this problem or if there are any suggestions as to what may be causing it. I'm also curious if other system's don't require patching. that'd be neat to know.
>>>
>>> ------------------------------------
>>> There are four example files that seem to work*: arpeggiate.py, flutescale.py, sgranr.py, and wanderfreq.py located in the examples/ folder. This gives you an idea of how PyRTCmix is meant to be used (here is flutescale):
>>> import PyRTcmix as p
>>> from time import sleep
>>>
>>> rrr = p.pyRTcmix()
>>> rrr.printOn()
>>> sleep(3)
>>>
>>> print ("loading metaflute...")
>>> rrr.cmd("load", "METAFLUTE")
>>> sleep(3) #just to be safe
>>> rrr.cmd("makegen", 1, 24, 1000, 0.0, 1.0, 1.0, 1.0)
>>> rrr.cmd("makegen", 2, 24, 1000, 0.0, 0.0, 0.05, 1.0, 0.95, 1.0, 1.0, 1.0)
>>> rrr.cmd("SFLUTE", 0.0, 1.0, 0.1, 106.0, 25.0, 5000.0, 0.5)
>>> rrr.cmd("SFLUTE", 1.0, 1.0, 0.1, 95.0, 21.0, 5000.0, 0.5)
>>> rrr.cmd("SFLUTE", 2.0, 1.0, 0.1, 89.0, 19.0, 5000.0, 0.5)
>>> rrr.cmd("SFLUTE", 3.0, 1.0, 0.1, 75.0, 19.0, 5000.0, 0.5)
>>> rrr.cmd("SFLUTE", 4.0, 1.0, 0.1, 70.0, 15.0, 5000.0, 0.5)
>>> rrr.cmd("SFLUTE", 5.0, 1.0, 0.1, 67.0, 16.0, 5000.0, 0.5)
>>> rrr.cmd("SFLUTE", 6.0, 1.0, 0.1, 56.0, 17.0, 5000.0, 0.5)
>>> rrr.cmd("SFLUTE", 7.0, 1.0, 0.1, 53.0, 25.0, 5000.0, 0.5)
>>>
>>> while(True):
>>> sleep(0.1)
>>>
>>> * weird bug when trying to 'import' any module after rtcmix. so far the examples only work if you use 'from package import module' or 'import package as p' syntax which is very very bizarre.
>>> Blaine
>>> _______________________________________________
>>> RTcmix-discuss mailing list
>>> RTcmix-discuss@...
>>> http://music.columbia.edu/mailman/listinfo/rtcmix-discuss
>>
>>
>> _______________________________________________
>> RTcmix-discuss mailing list
>> RTcmix-discuss@...
>> http://music.columbia.edu/mailman/listinfo/rtcmix-discuss
>>
>>
>> _______________________________________________
>> RTcmix-discuss mailing list
>> RTcmix-discuss@...
>> http://music.columbia.edu/mailman/listinfo/rtcmix-discuss
>
> _______________________________________________
> RTcmix-discuss mailing list
> RTcmix-discuss@...
> http://music.columbia.edu/mailman/listinfo/rtcmix-discuss
_______________________________________________
RTcmix-discuss mailing list
RTcmix-discuss@...
http://music.columbia.edu/mailman/listinfo/rtcmix-discuss
RTcmix-discuss mailing list
RTcmix-discuss@...
http://music.columbia.edu/mailman/listinfo/rtcmix-discuss
« Return to Thread: PyRTCmix on github
| Free embeddable forum powered by Nabble | Forum Help |