Posted: 30th Apr 2020 6:30
I posted that source for MIDI to show that it allready works
Posted: 30th Apr 2020 6:35
@Bored of the Rings

Yeah, I requested some more MIDI Functions.

EG: Read Midi notes from a External Midi device, Sending Notes to Midi Devices

I need more MIDI Specific Functions. Not only Play and Load... but more indepth

https://docs.microsoft.com/en-us/windows/win32/multimedia/summary-of-maps-and-midi-messages

https://docs.microsoft.com/en-us/windows/win32/multimedia/recording-midi-audio

For example.
I want to connect my MIDI device eg: Keyboard, Guitar, Drums to the MIDi device
Read the MIDI input NOTE and display a Music Score if selected Note
or
Display the Drums (on the PC)
or Make a Drum Pad, on the PC that send Midi Notes to the Midi device or Midi Mapper

Thanks
Danie
Posted: 30th Apr 2020 6:37
Another suggestion!

Read music frequency from the Mic,
For example. To build an Intrument Tuner...
Posted: 30th Apr 2020 6:43
@Bengismo

You can load and play midi files in AppGameKit already using the Music commands


What did I miss... I've tried that and couldn't get Midi files to load or play with loadmusic(1,"midifile.mid")
ogg and Mp3 fine

Any COMMAND I might have missed?
Posted: 30th Apr 2020 11:36
As Xaby said above:

https://forum.thegamecreators.com/thread/225975#msg2655275

it should just be Loadmusic() and PlayMusic()

It works fine for me and plays midi files. Ive tried it on 4 pc's with a number of different midi files without problems. It depends what platform your using though. As Xaby said... windows and android seem fine.
Posted: 2nd May 2020 2:02
Sprite collision detection would be awfully nice!
Posted: 2nd May 2020 6:57
no worries , I have made note of all requests, I will double check MIDI stuff and being a musician also it is defo somethng I should have checked first but not yet used AppGameKit for music If there are already MIDI commands that exist and work, no reason to reinvent the wheel.
great idea about sprite collision detection, although how this is not already in AppGameKit I have no idea.

I have been writing the new commands in both tier2 and tier1 (as a 3rd party plugin), so if all goes well I can submit as part of github code and see if it gets added in the future by Paul. Or just write dll commands as a third party plugin only for tier1.

Pointer commands for memblocks going well and I have done some initial speed comparison testing. Weirdly enough, the memblock pointer commands are faster in tier2, but in tier1 the memblock pointer commands are slightly slower in Tier1 when using a 3rd party plugin. It would probably be more beneficial to have Tier1 commands added to the main github source than by having to call them via 3rd party means.
Posted: 2nd May 2020 7:08
great idea about sprite collision detection, although how this is not already in AppGameKit I have no idea.

Theres a range of sprite collision even the command GetSpriteCollision( iSprite1, iSprite2 ) but I think what may be meant is
pixel perfect collision as the masking doesn't always do so well
Posted: 2nd May 2020 8:23
ah pixel perfect colliision, ok that would make sense. Please can i ask users to be more specific on their requirements as it gets confusing. thanks
Posted: 2nd May 2020 17:39
Sorry, my bad! I thought it was implicitly understood that I meant pixel perfect. I have been through the rather painful process of manually coding the adjustment of a collision shape frame-by-frame, and I didn't consider that others possibly didn't have the lack of pixel-perfect collision as fresh in mind.
Posted: 3rd May 2020 11:44
@Bored of the Rings

Please check PM

Thanks
Posted: 3rd May 2020 11:47
Edit: Ignore this! It's already done - as "shaders", I'm told.
------------------------------

2D sprite masking, in the sense of how programs like Flash or Animate define it where it's like looking through a window onto a sprite; the parts of the sprite that don't overlap with the "window" are invisible.

An image to clarify the concept, with mask sprite "A" hiding behind the backdrop "Bg" in the third panel so as to appear invisible:


Ideally SetSpriteShape could be applied to a masked sprite as you might expect - with invisible parts of the sprite being excluded from its hitbox.

My apologies if this is already in AppGameKit and I didn't notice it! I see someone asked about it in a thread a few years ago, but they were given a workaround that only applies to their particular example, and would not work in the case of multiple masked sprites moving independently of the background (and each other).
Posted: 3rd May 2020 14:24
I am sure that what you are talking about is done by shaders like this.



main.agc
+ Code Snippet
bg = LoadSprite("bg.jpg")

//------------------------------------------
spr = LoadSprite("spr.png")
SetSpritePositionByOffset(spr, GetVirtualWidth()/2, GetVirtualHeight()/2 )

//------------------------------------------
msk = LoadImage("msk.png")
shader_mask = LoadSpriteShader("shader.ps")
SetSpriteAdditionalImage(spr, msk, 1 )
SetSpriteShader(spr,shader_mask)

//------------------------------------------
do
    Sync()
loop


shader.ps
+ Code Snippet
#ifdef GL_ES
    #ifdef GL_FRAGMENT_PRECISION_HIGH
        precision highp float;
    #else
        precision mediump float;
    #endif
#endif

uniform sampler2D texture0;
uniform sampler2D texture1;
varying vec2 uvVarying;

void main()
{
    vec4 image = vec4(texture2D(texture0, uvVarying ));
    vec4 mask = vec4(texture2D(texture1, uvVarying ));

    float alpha = texture2D(texture1, uvVarying ).a;
    image.a=mix(0.0, mask.a, alpha);
 
    gl_FragColor = image;
}


UPD: Although not quite the same, you need to use full-screen shaders.
Posted: 3rd May 2020 21:04
Firebase Realtime database generate a random keys when we sent any value . how to solve it ?

and any function which give ip address from domain name
Posted: 3rd May 2020 22:48
Thanks, Qugurun. I just assumed these "shaders" everyone was talking about was a 3D lighting effect and never looked into it, as I haven't tried out 3D yet. Boy is my face red!
Posted: 5th May 2020 13:14
Pixel perfect sprite collision isnt too hard to do with a shader, depending on the type of collision. Do you mean for bullets etc, or for walking on the ground?
Posted: 5th May 2020 13:16
I'm moderately familiar with VS....I'd be interested in how you create a custom DLL that links in with AppGameKit personally. Perhaps when you are done you could post a guide or template?
Posted: 5th May 2020 14:47
Santman
Posted: 5th May 2020 18:48
Wow......I never knew rhthat was there.

T2 in general has quite lacking tutorials, but I'm stunned I missed that one. Thank you.
Posted: 5th May 2020 22:58
Here is a guide for developing plugins