Page 2 of 2

Re: PSG Module (including Music Macro Language)

Posted: Sun Feb 08, 2015 7:49 pm
by Joris
If I do activated the debugger these line appear when I start your source code with the second sample code paste below the Module source.
The program halts on the DisableDebugger line then...
[19:43:37] Waiting for executable to start...
[19:43:37] Executable type: Windows - x86 (32bit, Unicode)
[19:43:37] Executable started.
[19:43:37] [ERROR] PSG Module (including Music Macro Language).pb (Line: 71)
[19:43:37] [ERROR] Invalid memory access. (read error at address 143825308)
[19:43:48] The Program was killed.

Re: PSG Module (including Music Macro Language)

Posted: Wed Feb 11, 2015 8:46 am
by wilbert
Update Feb 11, 2015:
* Switched to mono buffers internally since I didn't use stereo output anyway.
* Added support for WMME; on Windows PortAudio isn't required anymore although you can still use it if you wish.

Re: PSG Module (including Music Macro Language)

Posted: Wed Feb 11, 2015 10:24 am
by Joris
The update works here.
(So it is really PortAudio that caused a problem.)

Re: PSG Module (including Music Macro Language)

Posted: Wed Feb 11, 2015 2:05 pm
by Kwai chang caine
The two version works great
Thanks for sharing 8)

Re: PSG Module (including Music Macro Language)

Posted: Wed Feb 11, 2015 4:14 pm
by wilbert
@Joris,
Thanks for checking. I'm glad to hear this one is working on your computer.

@KCC,
Always good to hear something is working :)


A few more demo tunes ...

Code: Select all

UseModule PSG

OpenWindow(0, 0, 0, 200, 100, "PSG Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

bass.s = "T11 \16 O2 V44 W1 L4 V+CV-E8E8 <FA> <V+GV-B8B8> CE :"
chords.s = "T11 \8 O4 V44 W4 L8 CEG>C< <FA>CF <GB>DG CEG>C< :"
melody.s = "T11 O5 W4 L4 CEC<G> CEC2 CEC<G> CE16R16E16R16C2 CEC<G> CEC2 CEC<G> C<G16>R16E16R16C2 :"

PSG_PlayMML(bass, chords, melody)

Repeat
  Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow

PSG_Terminate()

Code: Select all

UseModule PSG

OpenWindow(0, 0, 0, 200, 100, "PSG Test", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)

bass.s = "T11 O1 V48 W1 \8 L8  G4B-B-G4B-B-  G4>E-E-<G4>E-E-<  A>CF4<A>CF4<  F4AAGB->D4<"
chords.s = "T11 O3 V42 W4 \2 L8  GB->D4<GB->D4<  GB->E-<B-GB->E-<B-  A>CF4<A>CF4<  FA>C<AGB->D4<"
melody1.s = "T11 O5 V44 W4 \1 L4 GG2G8F8 E-E-2E-8D8 CCCD E-2D2"
melody2.s = "B-B-2B-8A8 GG2G8F8 CCCD E-2D2"
melody3.s = "B-B-2B-8A8 GG2G8F8 ACFA G2D2"

channel0.s = bass + ":"
channel1.s = chords + ":"
channel2.s = melody1 + melody2 + melody1 + melody3 + ":"

PSG_PlayMML(channel0, channel1, channel2)

Repeat
  Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow

PSG_Terminate()

Re: PSG Module (including Music Macro Language)

Posted: Fri Sep 18, 2015 7:11 am
by infratec
Hi,

the second example failed sometimes with 'Array index out of bounds'
A short look shows that the event data can be -2.
So I modified the code a bit:

Code: Select all

  If Event = #MML_Event
    EvData = EventData()
    If EvData >= 0
      StartDrawing(CanvasOutput(0))
        Circle(100, 50, 10, Colors(EvData))
      StopDrawing()   
    EndIf
  EndIf

Re: PSG Module (including Music Macro Language)

Posted: Fri Sep 18, 2015 8:02 am
by wilbert
infratec wrote:the second example failed sometimes with 'Array index out of bounds'
A short look shows that the event data can be -2.
Thanks for mentioning.
I updated the code. :)

Re: PSG Module (including Music Macro Language)

Posted: Sun Sep 20, 2015 1:29 pm
by mk-soft
Very cool :D

Works fine on Mac :wink:

Re: PSG Module (including Music Macro Language)

Posted: Sun Sep 20, 2015 1:48 pm
by dobro
excellent Thanks :)

Re: PSG Module (including Music Macro Language)

Posted: Sun Sep 27, 2015 5:41 pm
by xaby
Love you guys.

Does anybody know the SiON Project from Klei?
https://sites.google.com/site/sioncenter/example

The other question is, does anybody know, what with https://mmltalks.appspot.com is?
It was a great site for MML music, playing in the browser with the Flash API from SiON.

Best regards, xaby

Re: PSG Module (including Music Macro Language)

Posted: Thu Feb 11, 2021 11:54 pm
by xaby
I am still hoping, to find this code somehow without the ASM parts.
Or maybe if someone could translate these parts, that would be great.

Re: PSG Module (including Music Macro Language)

Posted: Fri Feb 12, 2021 6:33 pm
by Kwai chang caine
Wilbert wrote:@KCC,
Always good to hear something is working
Excuse me, not see your answer and your new melody :oops:

Image

2015 => 2021 i'm not sure you read that, but thanks for this nices two new musics 8)

Re: PSG Module (including Music Macro Language)

Posted: Mon Mar 22, 2021 7:28 pm
by spacebuddy
Wilbert,

Is there anyway to get this working on apple silicon (M1)?

Thanks

Re: PSG Module (including Music Macro Language)

Posted: Mon Mar 22, 2021 9:33 pm
by wilbert
spacebuddy wrote:Is there anyway to get this working on apple silicon (M1)?
I changed the import statement in the first post.
You can try again with that modified code.
Does that make a difference ?

Re: PSG Module (including Music Macro Language)

Posted: Mon Mar 22, 2021 11:39 pm
by spacebuddy
Hi Wilbert,

Yes, it works perfectly now, thank you.

This is going to be perfect for a game I am working on :)

Thanks