Welcome to %s forums

BrainModular Users Forum

Login Register

recycle C++ code

Create your own modules in C++
Post Reply
User avatar
oli_lab
Member
Posts: 1261
Location: Brittany, France
Contact:

Unread post by oli_lab » 09 Mar 2015, 11:31

Is it a long shot to adapt such a C++ code to build a module with Usine SDK ?

https://freddie.witherden.org/tools/dou ... /#download

this one is in Java but seems more simple :
http://www.openprocessing.org/sketch/57589
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

martignasse
Site Admin
Posts: 611
Location: Lyon, FRANCE
Contact:

Unread post by martignasse » 09 Mar 2015, 18:39

hey oli_lab,

after a quick look at the sources, the first one rely on 3 file for the algorythm, the rest is for QT integration.
it should be pretty easy to isolate the algo part, the 'big' work is to reconstruct the graphic part and how you sync that with the audio...
But you should be pretty comfortable with C++ coding to understand the file and code organisation and plug code at the right place


the second on is more simple, only one file for the algo and one for processing integration, but it's java, maybe require some code modif.

i suggest the second one,if it take you only few hours to make a module from it, you are on the right track.
Martin FLEURENT - Usine Developer - SDK maintainer

User avatar
oli_lab
Member
Posts: 1261
Location: Brittany, France
Contact:

Unread post by oli_lab » 09 Mar 2015, 21:29

thank you, that's encouraging
I was thinking of using the coordinates and angular datas of the 2 pendulae as modulation sources for spatialisation and/or FX...
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

martignasse
Site Admin
Posts: 611
Location: Lyon, FRANCE
Contact:

Unread post by martignasse » 09 Mar 2015, 22:49

oli_lab wrote:thank you, that's encouraging
I was thinking of using the coordinates and angular datas of the 2 pendulae as modulation sources for spatialisation and/or FX...
yep, seems like it makes sense, but what does it mean in term of module params inputs/outputs ;)

it's the big job (other than putting an algo in) about module...
how you control it and what they deliver (in a params point of view)
answer it and 50% of the job is done
Martin FLEURENT - Usine Developer - SDK maintainer

User avatar
oli_lab
Member
Posts: 1261
Location: Brittany, France
Contact:

Unread post by oli_lab » 10 Mar 2015, 08:23

inputs :
pendulum 1 length (0 - 10m)
pendulum 2 length (0 - 10m)
pendulum 1 mass (0- 10kg)
pendulum 2 mass (0- 10kg)
friction (0-1)
gravity (= 981)
reset (button 0-1)

outputs
xy coordinates of mass 1 (origin is a fix point as in XY pad)
xy coordinates of mass 2 (origin is a fix point as in XY pad)
xy coordinates of mass 2 (origin is mass 1)

all outputs will be 0 to 1
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

martignasse
Site Admin
Posts: 611
Location: Lyon, FRANCE
Contact:

Unread post by martignasse » 10 Mar 2015, 12:38

ben voila ;) y a plus qu'à :D
Martin FLEURENT - Usine Developer - SDK maintainer

User avatar
oli_lab
Member
Posts: 1261
Location: Brittany, France
Contact:

Unread post by oli_lab » 15 Apr 2015, 08:10

I identified something I need to do but don't know how...

in the Processing program, there is a framerate that is setup by default in Processing but here in SDK I'd need some sort of a clock to trigger the callback section at regular interval...

?
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

martignasse
Site Admin
Posts: 611
Location: Lyon, FRANCE
Contact:

Unread post by martignasse » 15 Apr 2015, 14:42

hey oli,

we don't have timer callback exposed in the sdk for now, but you can do it pretty easily.

in the onProcess you check the time with sdkGetTimeMs(), when it pass the period of your framerate goal , you send a callback notification to usine.
using sdkNotifyUsine (int Target, int Msg, int Param1=0, int Param2=0) with
Target = NOTIFY_TARGET_USER_MODULE
Msg = NOTIFY_MSG_USINE_CALLBACK
Param1 correspond to the Message->wParam (so the param index)
Param2 = MSG_CHANGE

make sure your pParamInfo->CallBackType = ctImmediate; for the concerned param

but depending on what you are doing in this callback, making a dedicated thread is maybe more appropriate

tell me if you need more
Martin FLEURENT - Usine Developer - SDK maintainer

User avatar
oli_lab
Member
Posts: 1261
Location: Brittany, France
Contact:

Unread post by oli_lab » 20 Apr 2015, 13:52

it's done, after "few" hours !
http://oli-lab.org

Win11 Ryzen9/32GB RAM - RME MADIFACE - SSL alpha link 4-16 - OSC capable interfaces

follow OLI_LAB adventures on Mastodon
@olivar_premier@mastodon.social

martignasse
Site Admin
Posts: 611
Location: Lyon, FRANCE
Contact:

Unread post by martignasse » 22 Apr 2015, 17:54

cool, i want to see that ;)
Martin FLEURENT - Usine Developer - SDK maintainer

Post Reply

Who is online

Users browsing this forum: No registered users and 112 guests