This forum is for Tips and Tricks. Please do not post any questions in this forum. It is only for information.
78 postsPage 4 of 4
1, 2, 3, 4
Thanks Nelios. I'll convert that Image Searching bit to a VB module and and post it back for anyone going that route. Nice code.

Much appreciated.
User avatar
by Nelios on Wed Jul 09, 2014 5:59 am
You don't have to convert it: compile it to a dll, add a reference to your VB project & you can use it.
Something like that (you still have to add a reference). I'll try to do a proper documentation anyway (no VB though, it's really that bad -_-).
User avatar
by Lawrence on Wed Jul 09, 2014 6:43 am
Oh for sure. I was going to convert it just to have a VB code reference to the methodology of how you got there,... but as I converted it occurred to me that the "unsafe" code pointers don't easily convert, they'd have to be somewhat rewritten for VB using comparative methods.

My intent there was to study the approach and apply that method in other applications I may work on, so I was converting it mostly for me. I like to keep source code libraries of stuff like that since I prefer coding in VB.

But yeah, I've already compiled the dll, just need to test it.

no VB though, it's really that bad

We're beyond all that. :lol: I know you C guys like to draw lines in the sand but we shouldn't dwell on that here. :)
User avatar
by Lawrence on Wed Jul 09, 2014 7:47 am
Feedback: It works really great. I put a bmp of the power button into a picture box to compare and ran this test code (after referencing the DLL in the project) ...

    Dim Nelios = New Nel_S1Library.ImageSearch.ImageSearch
    Nelios.CaptureApplication(S1)
    Dim retval = Nelios.searchBitmap(PowerButton.Image, 0)

... and above, retval returns an array of the x,y locations [ retval(index).top (and bottom etc, the rect ] of all the power buttons on the screen. Nice. I played with the tolerance parameter a little to see how the result vary.

I think I may actually use the + sign from the console as the image match target and shift by that known gap since I don't know if using one match picture will get both the on and off states with them being different graphic colors.

Great code. Two big thumbs up.

I'll replace the relevant bits in my tool with those functions for my version of the snapshot tool and also look to resource that dll in some other similar ways there for other data bits that may apply. Great stuff.
User avatar
by Lawrence on Wed Jul 09, 2014 10:39 am
For Nelios or others:

The code works great but I can't (hey, I'm a bit of a relative hack :)) figure out the screen clicking bit. I thought I could use the mouseevent API to click anywhere on the screen by just passing the X,Y but that's not working. When I point the X,Y directly to the S1 handle, it works great, but (given the window offset) the coords need a minor adjustment, which we don't want anymore with the new Image Search code he wrote.

In this case with his demonstrated method that's best, not clicking on the app, we of the lesser coding school may need a reference code line for that. :)

Additionally, what I did with the image to match is I copied the highlighted (selected track) image of the + sign. The reason I did that is because it allows ranging from the selected track instead of always from the first visible track. So (in my context anyway) it will always start from the currently selected track, which is better for my needs, so I'm only using the first returned index from the image search and ranging from there.

Note: Actually, in that case, it only returns 1 array item anyway unless you have multiple tracks selected.

One other interesting thing that popped up when my offsets missed... a Micro View opened up and it made me think...

"Hmmm... that clicking code can be easily offset from the image search X,Y to range across a set of channels and toggle Micro Views for the first FX row."

... at least on the first row of FX, after that the subsequent row panels Y positions are unpredictable.

Image

So for me (I typically work with Pro EQ's in all the slot 1's) that will be cool, to throw them in and out of Micro View in series, which was an old FR of mine ... "Toggle Micro View (selected tracks, slot x or all)".

P.S. His function should also work for targeting those text fields for volume and pan. It would probably just have to image match something close to them on the channel that's static though, and do offsets from there, since those text fields change. That would completely remove my little klunky setup screen.
User avatar
by Lawrence on Wed Jul 09, 2014 2:59 pm
Okey dokey...

I redesigned the UI a little, got rid of the filter checkbox column and added a global filter option that affects everything. When that option is checked, Restore or Reset only affects the selected channels, like the highlighted blue rows below.

The filters are working great now and the whole setup bit is gone thanks to Nelios. I'll do another video sometime later.

Stitched from 2 images below to fit the forum image height restriction.

Image
Image

The big caveat here is the currently static sequencing. In order to make it non-contiguous, I can do name matching, like match the track name from the grid to the track name in the S1 track to make sure the right track is being affected... so you can freely move tracks around S1 while working and still use this tool and not worry about all the tracks being in a static order.

It shouldn't be too hard to do, to pull all the track names into an array first and cross check before changing channel settings. That's one thing I want to look at before I let this thing loose. Doing that will likely visibly slow it down though, I'll see.

P.S. There are still two invisible columns there that will fit with the current files being written and read so there's still space in the file format for new data without breaking the Alpha file format.
User avatar
by Nelios on Wed Jul 09, 2014 3:51 pm
Sorry, I haven't been able to post today, no internet :/ I'll post some code to show you how to click. The point needs an adjustment in code btw, you are right. I decided to not hardcode it so that you can use it anywhere. As you've seen it's quite powerful! Glad you like it. I found the imagesearch bit on google, I adapted it to our need and combined it with a screencapture. Anyway, I'll make a proper post tomorrow, I'm on mobile right now...
User avatar
by roblof on Wed Jul 09, 2014 3:57 pm
When I looked at doing plugin work for s1 I seem to remember that I found out that all the tools in s1 is written in javascript...

Studio One Pro v5, Notion 6, Nuendo 11, BitWig v3, Reaper v4, Ableton Live 8 Suite, iMac late 2015, Behringer Wing/x32-BigBoy/x32-rack all with Dante/aes67 and s16/sd16 stageboxes, Flow8, Waves x-wsg with SoundGrid server, Behringer X-Touch, X-Touch ONE, M-Air mr18, X-Air xr18, DP48, Hub4 and p16 monitor systems, TurboSound iQ-speakers, Motör 61, BCR-2000, FirePod 10, Apogee Ensemble, Alesis HD24, NI Komplete 12 Ultimate Collectors, Halion 6, True Temperament Frets on basses and guitars, Katana-100, DT-50, JSX, JCM800, Korg Kronos, Roland vk-7, Behringer Deepmind 12, Behringer Neutron
User avatar
by Lawrence on Wed Jul 09, 2014 5:21 pm
Here's a short vid, no voice or graphics, just showing how some of it works now in this state. I'll be (I have to intentionally really) taking a good 3-4 day break away from this or I'd be at it non-stop until I'm completely happy with the result, which is almost never... :( ... and/or new ideas to investigate don't suddenly keep occurring to me keeping me from just putting it away for awhile.

So it's time for a long and necessary break.

I named this alpha build "Alphalfa" because he looks just like how I feel about some of the directions that keep swirling around in my head. :lol: :)

Image

phpBB [video]
User avatar
by Nelios on Thu Jul 10, 2014 7:59 am
New update:
  • Added an example.
  • Merged the dlls together (ImageSearch & Nel_S1Library).
  • New documentation.
_______________

Now for the decent post I said I'd do yesterday:

My intent there was to study the approach and apply that method in other applications I may work on, so I was converting it mostly for me. I like to keep source code libraries of stuff like that since I prefer coding in VB.

LMike, honestly, if you want to learn some more, try to do some C# instead of converting it to VB. It'll be much more useful (it's not that complicated).
Once again, I will NOT document VB implementations, sorry (if someone else does it, I'll add it though).

... and above, retval returns an array of the x,y locations [ retval(index).top (and bottom etc, the rect ] of all the power buttons on the screen. Nice. I played with the tolerance parameter a little to see how the result vary.

You want to use location[index].X & location[index].Y with your bitmaps' width & height to get precise positions. You may need an offset though, S1 mouse positioning is not relative to the screen(shot) but to its own interface. Anyway, it's quite easy to find the values you need, once you've got them, add them to your clicks. That's how it works for now, I prefer it that way since it means it has no limitations!

I think I may actually use the + sign from the console as the image match target and shift by that known gap since I don't know if using one match picture will get both the on and off states with them being different graphic colors.

As of which (small/sample) pictures to use, get something unique, something that'll work 100% of the time. Don't get the icon alone, try to add a bit more informations on the sides. You can check the example I added to have an idea.

The code works great but I can't (hey, I'm a bit of a relative hack :)) figure out the screen clicking bit. I thought I could use the mouseevent API to click anywhere on the screen by just passing the X,Y but that's not working. When I point the X,Y directly to the S1 handle, it works great, but (given the window offset) the coords need a minor adjustment, which we don't want anymore with the new Image Search code he wrote.

You shouldn't use the mouseevent api because it moves the cursor (with C# it does at least), you want to use SendMessage/PostMessage. But you don't have to, the library provides it already. Simply use LeftClick(x,y)/RightClick(x,y) (there are more methods with more parameters if you need mod keys &/or a different handle). As I said: yes you need an offset which should always be the same (I mean it should work everywhere with only one offset, could be wrong though, I haven't tested it thoroughly).

Additionally, what I did with the image to match is I copied the highlighted (selected track) image of the + sign. The reason I did that is because it allows ranging from the selected track instead of always from the first visible track. So (in my context anyway) it will always start from the currently selected track, which is better for my needs, so I'm only using the first returned index from the image search and ranging from there.

It works, I made it so that you can do something like that! I don't want to force anything (unless necessary). You've already seen a possibility it offers :) It's as general as possible. Requires more work on the code side, but that's not a big deal imo.

I redesigned the UI a little, got rid of the filter checkbox column

The way you handled this problem is great. I love it, it's way better (less clicks = better).

The big caveat here is the currently static sequencing. In order to make it non-contiguous, I can do name matching, like match the track name from the grid to the track name in the S1 track to make sure the right track is being affected... so you can freely move tracks around S1 while working and still use this tool and not worry about all the tracks being in a static order.

We'll be able to 'crack' it sometimes, I'm sure. The problem might be to make it fast...

I'll be (I have to intentionally really) taking a good 3-4 day break away from this or I'd be at it non-stop until I'm completely happy with the result

Fair enough, it's actually a 'skill' to say that something is done. Remember that it doesn't have to be finished to release it (Github, SVN, things like that helps a lot... You can update later!).

Thanks :)
User avatar
by Lawrence on Thu Jul 10, 2014 9:07 am
LMike, honestly, if you want to learn some more, try to do some C# instead of converting it to VB. It'll be much more useful (it's not that complicated).


I thought we were well past all that. :) I do occasionally diddle in C#, but it's not my personal preference for the things I personally do or even want to do, so there's not much point in me learning it more when VB easily does what - I personally need and want to do - just fine, in my context. I am not seeking employment as a coder nor competing with professional C coders, never was.

Everyone else is perfectly free to choose differently, to make that choice for themselves, as relates to their own personal preferences and/or any perceptual advantages or personal comfort.

But (obviously) if you want to teach C# here in this thread, have at it. I'm sure there are some here interested in that. It would be on topic as relates to hacking add-ons. I used VB in the original post for one reason, because that's my personal preference for this kind of thing, but that shouldn't restrict the thread to only that language, nor do I assume my personal preferences there will necessarily translate directly to anyone else's.

Thanks Nelios.
User avatar
by Nelios on Sat Jul 12, 2014 9:08 am
Just finished updating the repo. Added keyboard functionalities (with a max of 3 modifiers). Check the example included if you have doubts on how to use it, should be quite simple though.

Any suggestions/requests?

I'll update my application to use the library next.

Edit: It appears that the method I use (to send keys) only works globally (it doesn't work as intended if you want to paste notes for example). I'll look into it.
User avatar
by Lawrence on Sat Jul 12, 2014 11:18 am
Image
User avatar
by tjgoa on Sun Jul 13, 2014 5:12 pm
Just created a thread about snapshots wishlist I hope someone might be able to create an extension for.
viewtopic.php?f=111&t=604
User avatar
by tjgoa on Sun Jul 13, 2014 11:59 pm
Sorry new to this forum and not sure where to post but it seems you guys are already working on my wishlist. Here is the post I created in wishlist forum :

I was wondering if maybe someone could create an extension that saves snapshots of a song which include all the mixer, fx, and instrument settings. I know a lot of people would really appreciate this feature in studio one. Also it would awesome if these snapshots would also retain all the vst/vsti parameter changes from snapshot to snapshot. Say you tweaked the filter or osc octaves on a synth, then save snapshot and continue tweaking until another settings sound good. This would of course apply to many synths etc.

Until now I would usually just save another song version once I programmed something good to preserve then continue along until another mix sounds good, then continue the process. In a way It'd be similar to jerry rigging a pattern based work mode of sorts. Would be good to also drag and drog snapshots on the song arranger as well to build up the various snapshots.

Another work around is to select all the vsti's then save to audio track then duplicate them to another track with events and finally re-transforming the originals back into instrument track modes for further editing. Then just drag all the duplicated transformed audio tracks into another region into playlist thus preserving the mix or rather the 'snapshot' of a mix. Would be totally awesome if this feature were available in studio one. This feature is available in reaper to an extent, just not preserving the vsti synth parameters only the mixer parameters. But both vsti' synth paramets, song arrangement and mixer parameters seems a worthy addition to this worthy Daw Studio One 2. Here is a link about the reaper extension.


Edit* Seems like you guys are on the ball already. Awesome!!! I would just like to put in the request to save the instrument vsti data along with the mixer settings etc if possible.
User avatar
by Lawrence on Mon Jul 14, 2014 1:01 pm
Yes, we made some good progress there, largely thanks to Nelios.

After taking a break from that adventure I think I'll keep this particular thing under wraps or shelved until I see what 3.0 looks like, which (obviously) could be many months away as far as any of us know, but there's no really pressing need for me, even though I may still use it a little along the way.

Of course, that's just me. The source code and examples are out there to be used by anyone feeling differently about all that, but chasing user bugs is not something I'm all that interested in doing right now and once you cross that bridge with a public share of a beta build, well, it's crossed.

But, of course, Nelios may release something.
User avatar
by gbsr on Tue Jul 29, 2014 5:02 pm
Awesome, thanks!
We NEED a dedicated extensions and scripting subfora now.
User avatar
by navjotsingh4 on Wed Sep 22, 2021 5:03 am
if anyone still active here please tell my how to start writing codes for studio one in visual studio. please give me something to start

78 postsPage 4 of 4
1, 2, 3, 4

Who is online

Users browsing this forum: No registered users and 45 guests