denver - library to play waveforms (synthesizer included)

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
SuperZazu
Citizen
Posts: 56
Joined: Sun Jun 10, 2012 2:06 pm
Location: France
Contact:

denver - library to play waveforms (synthesizer included)

Post by SuperZazu » Mon Jan 19, 2015 6:15 pm

Hello,

Here's a new library I made : denver.lua.
That's a little helper to play custom waveforms : it simply generates a sample that you can play with LÖVE.

Basic examples :

Code: Select all

local denver = require 'denver'

-- play a sinus
local sine = denver.get('sinus', 440, 1) -- create a sample of 1sec, at the frequency of 440Hz (note that you can also play square, sawtooth and triangle waves)
love.audio.play(sine)

-- play a note
local square = denver.get('square', 'F#2', 1) -- you can also specify a note : C4, A#2, Fb5
love.audio.play(square)

-- play a looped wave
local saw = denver.get('sawtooth', 440) -- if you want to loop your sound, don't specify a length
saw:setLooping(true)
love.audio.play(saw)

-- play noise
local noise = denver.get('whitenoise', 6) -- 6sec of white noise (you can also use pinknoise and brownnoise)
love.audio.play(noise)


-- bonus : plays a binaural beat (you can use denver.stopBinauralBeat() to stop it)
denver.playBinauralBeat(432, 4, true) -- carrier frequency of 432Hz and a perceived frequency of 4Hz, with pink noise
:-)
Attachments
synth.love
example of a basic virtual synthesizer (using the keyboard)
(6.28 KiB) Downloaded 138 times
Last edited by SuperZazu on Tue Jan 20, 2015 11:12 pm, edited 2 times in total.

User avatar
Dreanh
Prole
Posts: 27
Joined: Fri Oct 10, 2014 2:36 am
Location: Norway

Re: denver - library to play waveforms

Post by Dreanh » Tue Jan 20, 2015 1:49 am

Cool library, played around with it for some hours. Made a piano/keyboard thing. :P
Attachments
Keybørd.love
WTFPL
(8.5 KiB) Downloaded 159 times

User avatar
SuperZazu
Citizen
Posts: 56
Joined: Sun Jun 10, 2012 2:06 pm
Location: France
Contact:

Re: denver - library to play waveforms

Post by SuperZazu » Tue Jan 20, 2015 5:23 pm

Dreanh wrote:Cool library, played around with it for some hours. Made a piano/keyboard thing. :P
Impressive ! :-D

User avatar
Rucikir
Party member
Posts: 128
Joined: Tue Nov 05, 2013 6:33 pm
Location: Paris
Contact:

Re: denver - library to play waveforms

Post by Rucikir » Tue Jan 20, 2015 10:20 pm

Why would a note stop after a given time ? Why haven't you make it last until the key is released (like in a real piano) ?

The library is really cool !
Lua script to distribute your LÖVE games. love-release.lua : Forum | Github
@Rucikir

User avatar
SuperZazu
Citizen
Posts: 56
Joined: Sun Jun 10, 2012 2:06 pm
Location: France
Contact:

Re: denver - library to play waveforms

Post by SuperZazu » Tue Jan 20, 2015 10:58 pm

Rucikir wrote:Why would a note stop after a given time ? Why haven't you make it last until the key is released (like in a real piano) ?

The library is really cool !
Well it would be simple to do :-) Here's a simple example.
EDIT: I didn't do it because it wasn't the goal of the library, I just wanted to make things easier when you want to generate some sounds.
Attachments
synth.love
(6.28 KiB) Downloaded 93 times

User avatar
whitebear
Citizen
Posts: 86
Joined: Sun Mar 15, 2009 1:50 am

Re: denver - library to play waveforms (synthesizer included

Post by whitebear » Fri Jan 23, 2015 2:48 pm

Here is something I coded last night before going to bed for android. It was quick because I already have barebones-file for the device.
Today I did some quick tweaking to get it working on pc and used shine lib to make it less ugly.

Its inspired by http://tonematrix.audiotool.com/

it was fun experiment ^^
Attachments
notes.love
v1
(21.29 KiB) Downloaded 110 times

User avatar
SuperZazu
Citizen
Posts: 56
Joined: Sun Jun 10, 2012 2:06 pm
Location: France
Contact:

Re: denver - library to play waveforms (synthesizer included

Post by SuperZazu » Wed Feb 11, 2015 12:31 pm

I really like what you did, it surely is very nice. :-)

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests