Arrowhead

Until our dedicated user library is in place you can post examples and modules here

Moderators: electrogear, exonerate

Arrowhead

Postby mwvdlee on Thu Jul 29, 2010 8:34 pm

Inspiration from the graphics overlays by Trogluddite of the Goniometer: viewtopic.php?f=7&t=9658
Implementation based on the work of myself and (again) Trogluddite on filled polygons: viewtopic.php?f=7&t=9597

Drawing a line with an arrowhead at (x,y)!

Arrowhead.osm
(13.57 KiB) Downloaded 186 times

All configurable as properties at the moment, but the goal is to make it function like a standard GUI primitive.
There are multiple methods to draw solid arrowheads, but I think this is the fastest one when considering the mathemathics involved (no trigonometry except a hypothenuse). Haven't tried others to compare. The benefit of other methods is that they might allow different arrowhead styles.

As for a license; Use it however, whenever and wherever you want and you don't need to credit me or any other author who duplicates or modifies this work.
My current top SynthMaker bug:
    1. MIDI Input issue (showstopper, no workaround)
    2. All my previous bugs in SM1.7, because bug 1 makes SM2 worse than SM1.7
User avatar
mwvdlee
smanatic
 
Posts: 552
Joined: Thu Dec 03, 2009 8:42 am
Location: NL

Re: Arrowhead

Postby mwvdlee on Fri Jul 30, 2010 6:36 am

Here's a version with two heads (switchable) at either end.

Arrowheads 002.osm
(18.44 KiB) Downloaded 129 times

It needs to be cleaned up quite a bit, but I have to go to work now :)
On the one hand, things would be cleaner and nices to look at if put into modules.
On the other hand, extra modules decrease performance so just moving the wires around would be better quality-wise.
p.s. Does having curvy wires decrease performance?
My current top SynthMaker bug:
    1. MIDI Input issue (showstopper, no workaround)
    2. All my previous bugs in SM1.7, because bug 1 makes SM2 worse than SM1.7
User avatar
mwvdlee
smanatic
 
Posts: 552
Joined: Thu Dec 03, 2009 8:42 am
Location: NL

Re: Arrowhead

Postby infuzion on Fri Jul 30, 2010 7:07 am

mwvdlee wrote:On the other hand, extra modules decrease performance so just moving the wires around would be better quality-wise.
p.s. Does having curvy wires decrease performance?
Of it running, no. Tiny tiny difference for load-times. Not a big deal usually, but once you get to monster-OSMs like McBarGig's guitar amp sims or a few projects I've worked on, every little extra thing adds up.
I tend to avoid curves in wires since not everyone has the same curve settings, so what may look good on your computer can look unreadable on another person's config. I use rarely when needed, like linking to something to the left of the output.
Need help? First search the forum & WiKi, then post in the help forum with a clear topic, request, & OSM. Then please WiKi the correct solution. If you want my personal assistance, I charge by the hour or for an exchange of services.
infuzion
smstar
smstar
 
Posts: 6163
Joined: Wed May 04, 2005 8:02 pm
Location: Earth, USA, CO, Denver

Re: Arrowhead

Postby mwvdlee on Sat Jul 31, 2010 9:02 am

Well, here's a version with double arrow heads that kinda acts like a standard GUI primitive.
There's also some other goodies in here which you might enjoy ;)

Arrowheads 003.osm
(14.46 KiB) Downloaded 125 times

The wires are a mess, but I don't really feel like cleaning it up right now.
My current top SynthMaker bug:
    1. MIDI Input issue (showstopper, no workaround)
    2. All my previous bugs in SM1.7, because bug 1 makes SM2 worse than SM1.7
User avatar
mwvdlee
smanatic
 
Posts: 552
Joined: Thu Dec 03, 2009 8:42 am
Location: NL

Re: Arrowhead

Postby aliasant on Sat Jul 31, 2010 12:40 pm

That was really nice! Very cool and will get usefull for sure.
That swinger might solve some of my over complicated GUIs :)

I did however get some weird results.
First I placed "Thru if changed" float modules o prevent triggers when the swing is damped.
That worked nicelly if the Swing value was under 1.

The oddity was that I messured the triggers sent into the redraw module and I go 2x triggers from the "Limit" Prim compared to just get it directly from the A.

Can anyone confirm that or is it SM screwing with my PC again?
Attachments
Arrowheads%20003 Weird triggers.osm
(25.25 KiB) Downloaded 114 times
It's never to late to be late.....
http://martinrodensjo.smugmug.com/
User avatar
aliasant
smunatic
 
Posts: 2386
Joined: Sat Dec 30, 2006 5:49 pm
Location: Sweden

Re: Arrowhead

Postby trogluddite on Sat Jul 31, 2010 1:29 pm

aliasant wrote:2x triggers from the "Limit" Prim

Yes, I get the same here. Hardly desired behaviour from something that's intended to reduce triggers - think I'll be skipping that primitive from now on!
Cool little project, looks very sweet - the only thing I would say is that I can see a lot of triggers being generated long after the motion on screen appears to have stopped. Must be very tiny oscillation still happening that equate to less than one pixel.
Feel free to use any schematics and algorithms I post on the forum in your own designs - a credit is appreciated (but not a requirement).
Don't stagnate, mutate to create. Without randomness and serendipity the earth would be just another barren rock.
User avatar
trogluddite
smychopath
 
Posts: 3024
Joined: Mon Oct 20, 2008 3:52 pm
Location: Yorkshire, UK

Re: Arrowhead

Postby aliasant on Sat Jul 31, 2010 1:49 pm

trogluddite wrote:
aliasant wrote:2x triggers from the "Limit" Prim

Yes, I get the same here. Hardly desired behaviour from something that's intended to reduce triggers - think I'll be skipping that primitive from now on!
Cool little project, looks very sweet - the only thing I would say is that I can see a lot of triggers being generated long after the motion on screen appears to have stopped. Must be very tiny oscillation still happening that equate to less than one pixel.


Ok.
Filed a bug report. Thanx.

About to many triggers.
Quantize the float by 8 (or maybe 16 to give it some space) before it goes into a "Thru if changed" float module.
This happens before the feedbacks and out from the swing module.
It's never to late to be late.....
http://martinrodensjo.smugmug.com/
User avatar
aliasant
smunatic
 
Posts: 2386
Joined: Sat Dec 30, 2006 5:49 pm
Location: Sweden

Re: Arrowhead

Postby mwvdlee on Sat Jul 31, 2010 2:37 pm

I see the exact same problem. The limitter should really output at most at screen refresh rate and never more than the input, so I'm glad it's reported as a bug.

aliasant wrote:
trogluddite wrote:
aliasant wrote:2x triggers from the "Limit" Prim
Cool little project, looks very sweet - the only thing I would say is that I can see a lot of triggers being generated long after the motion on screen appears to have stopped. Must be very tiny oscillation still happening that equate to less than one pixel.

To my defence, the project was really about the arrowheads ;)

The easiest way to stop the oscillations is to implement a treshhold; i.e. don't transmit any changes less than 0.01. Please note that with anti-aliassing, you can have subpixel accuracy. That stops becoming visible on most displays at 1/256th of a pixel, but you probably won't be able to see a difference at much larger thresholds. Here's a version that does just that (based on aliasant's mod):

Arrowheads 004.osm
(25.23 KiB) Downloaded 130 times

Note that for some values of swing/dampen, it can get out of control and lock up by going to infinity.
Keep everything above zero and below 2 and keep atleast one of them at 1 or less and you'll be safe. Anything else is undefined behaviour for now :)

p.s., the whole idea for Swinger is based on jQuery animation effects, which essentially have the same function. There are a lot more different effects you could do like this than just the swinger.
My current top SynthMaker bug:
    1. MIDI Input issue (showstopper, no workaround)
    2. All my previous bugs in SM1.7, because bug 1 makes SM2 worse than SM1.7
User avatar
mwvdlee
smanatic
 
Posts: 552
Joined: Thu Dec 03, 2009 8:42 am
Location: NL

Re: Arrowhead

Postby mwvdlee on Sat Jul 31, 2010 2:58 pm

Based on the bug report; here's a 25 frames-per-second limiter.
A 50 fps version should probably be based on a timer, since Ticker 100 runs at about 66 2/3 fps :)
Then again, 66 2/3 is pretty close to screen refresh.
There really should be a Ticker 50 primitive; it'd be much more practical than both the 100 and the 25.

VisualTrigLimit.osm
(3.32 KiB) Downloaded 140 times


p.s., the Swingers animate using a Ticker 25, to a Limit primitive would have been useless anyway ;)
My current top SynthMaker bug:
    1. MIDI Input issue (showstopper, no workaround)
    2. All my previous bugs in SM1.7, because bug 1 makes SM2 worse than SM1.7
User avatar
mwvdlee
smanatic
 
Posts: 552
Joined: Thu Dec 03, 2009 8:42 am
Location: NL

Re: Arrowhead

Postby aliasant on Sat Jul 31, 2010 3:10 pm

Its funny.
I hooked a green osc to one of the swingers so that I can wach the animation without touching any of the knobs.
Then use Process Explorer to see how mu cpu Synthmaker us using... and I get 0.00%
That is with the window sized to 92x55 grids. Pretty amazing ey?

Then I replaced he 25 ticker with a 100 ticker and still about 0.00% with occasional spikes up at 0.38%
If I use the limiters trigger cpu usage doubles of course >:(

Now were is that "Search & Replace" in schematics function?
It's never to late to be late.....
http://martinrodensjo.smugmug.com/
User avatar
aliasant
smunatic
 
Posts: 2386
Joined: Sat Dec 30, 2006 5:49 pm
Location: Sweden

Re: Arrowhead

Postby philter5 on Sat Jul 31, 2010 3:14 pm

aliasant wrote:...Now were is that "Search & Replace" in schematics function?


oh yes it would be really nice to have this option... :D
---Yes, a piece of software CAN be your best friend---
User avatar
philter5
smaniac
 
Posts: 1478
Joined: Thu Jan 04, 2007 7:52 pm
Location: Germany

Re: Arrowhead

Postby mwvdlee on Sat Jul 31, 2010 3:59 pm

aliasant wrote:Then I replaced he 25 ticker with a 100 ticker and still about 0.00% with occasional spikes up at 0.38%
If I use the limiters trigger cpu usage doubles of course >:(

What?
Double CPU usage?
Two times 0%?
Damn those limiters!

:P ;)
My current top SynthMaker bug:
    1. MIDI Input issue (showstopper, no workaround)
    2. All my previous bugs in SM1.7, because bug 1 makes SM2 worse than SM1.7
User avatar
mwvdlee
smanatic
 
Posts: 552
Joined: Thu Dec 03, 2009 8:42 am
Location: NL

Re: Arrowhead

Postby Jay on Sat Jul 31, 2010 4:08 pm

nice stuff mwvdlee!

I like the arrow things and all that but i really like the trigger limiter! i will use that from now on! :)

on my SM machine the toolbox trigger limiter appears to do absolutely nothing at all when hooked up to a counter and being pulsed with either a tick25 or tick100.It gives the exact same count as ticker to counter. So what is it supposed to do? or should it work like the one mwvdlee has made and its broken?

Thanks Mwvdlee

Best Regards
The history of science shows that theories are perishable.With every new truth that is revealed,we get a better understanding of Nature and our conceptions and views are modified. - Nikola Tesla.
http://www.energeticforum.com/renewable-energy/
Jay
essemilian
 
Posts: 468
Joined: Mon Sep 22, 2008 7:20 pm
Location: Scotland.UK

Re: Arrowhead

Postby aliasant on Sat Jul 31, 2010 4:27 pm

mwvdlee wrote:
aliasant wrote:Then I replaced he 25 ticker with a 100 ticker and still about 0.00% with occasional spikes up at 0.38%
If I use the limiters trigger cpu usage doubles of course >:(

What?
Double CPU usage?
Two times 0%?
Damn those limiters!

:P ;)


=P :P

Jay.

Read from top again. We have explained what it is supposed to do, as far as we can guess from he description, and what it actually does. ;)
It's never to late to be late.....
http://martinrodensjo.smugmug.com/
User avatar
aliasant
smunatic
 
Posts: 2386
Joined: Sat Dec 30, 2006 5:49 pm
Location: Sweden

Re: Arrowhead

Postby mwvdlee on Sat Jul 31, 2010 4:44 pm

Jay wrote:but i really like the trigger limiter! i will use that from now on! :)

Please hold off on that for now.
It may be that the Limit primitive is basically the same as a Trigger Switch + VST Editor Open, in which case part of the "25fps Limit" module might be improved.

Anyway, this Arrowhead topic is now basically about three different topics. How about we split off the Limit and Swinger stuff into their own threads so the individual threads can focus on perfecting their respective arts?
My current top SynthMaker bug:
    1. MIDI Input issue (showstopper, no workaround)
    2. All my previous bugs in SM1.7, because bug 1 makes SM2 worse than SM1.7
User avatar
mwvdlee
smanatic
 
Posts: 552
Joined: Thu Dec 03, 2009 8:42 am
Location: NL

Next

Return to Examples

Who is online

Users browsing this forum: No registered users and 0 guests