Euterpea / Euterpea2-Examples

Small code examples demonstrating the use of Euterpea2 and HSoM
30 stars 15 forks source link

Running the example using ghc or emac. #1

Closed rdtor closed 5 years ago

rdtor commented 5 years ago

Hi, it is offrelated topic to the repo so feel free to close the issue. I been trying to run the demo examples by using ghc example.ghc inside the directory it says compile ok and one module loaded, but there is no sound. And what is the command to execute the program using emacs in haskell mode?

donya commented 5 years ago

The examples are meant to be loaded from GHCi and used interactively, not compiled with GHC. To run a command, just type it into the interpreter. Signal-level examples will produce WAV files when executed (no sound playback). If you want to compile with GHC, you need to write a main function with type IO().

For debugging MIDI playback, first test whether this command:

play $ c 4 qn

produces sound in GHCi. If it does, you can simply use "play x" where x is the name of the Music value you want to play. If you have no sound from the command above, check the instructions for your OS here: http://www.euterpea.com/euterpea/setting-up-midi/ On Mac/Linux, make sure you have a synthesizer running before starting the program or opening GHCi and then check the device numbers with the "devices" function in GHCi (you may need to use "playDev" instead of "play").

I don't use Emac and so don't know the Haskell-related commands offhand.

rdtor commented 5 years ago

Thank you i managed to setup atom with haskell and it works flawlessly also all the examples.

On Mon, May 6, 2019 at 7:18 PM Donya Quick notifications@github.com wrote:

The examples are meant to be loaded from GHCi and used interactively, not compiled with GHC. To run a command, just type it into the interpreter. Signal-level examples will produce WAV files when executed (no sound playback). If you want to compile with GHC, you need to write a main function with type IO().

For debugging MIDI playback, first test whether this command:

play $ c 4 qn

produces sound in GHCi. If it does, you can simply use "play x" where x is the name of the Music value you want to play. If you have no sound from the command above, check the instructions for your OS here: http://www.euterpea.com/euterpea/setting-up-midi/ On Mac/Linux, make sure you have a synthesizer running before starting the program or opening GHCi and then check the device numbers with the "devices" function in GHCi (you may need to use "playDev" instead of "play").

I don't use Emac and so don't know the Haskell-related commands offhand.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Euterpea/Euterpea2-Examples/issues/1#issuecomment-489622069, or mute the thread https://github.com/notifications/unsubscribe-auth/ALEWFOAVSVSRWTNM3QO23ZDPUAXUDANCNFSM4HK55WLQ .