Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - ElementCoder

Pages: 1 [2] 3 4 ... 46
16
Computer Programming / Re: pocketsphinx
« on: July 07, 2014, 01:11:59 pm »
I found an example on http://people.csail.mit.edu/hubert/pyaudio/#examples which I think has the necesarry options. I guess you'd have to change the CHANNELS to 1 and the RATE to its 16kHz equivalent.
Code: [Select]
"""PyAudio example: Record a few seconds of audio and save to a WAVE file."""

import pyaudio
import wave

CHUNK = 1024
FORMAT = pyaudio.paInt16
CHANNELS = 2
RATE = 44100
RECORD_SECONDS = 5
WAVE_OUTPUT_FILENAME = "output.wav"

p = pyaudio.PyAudio()

stream = p.open(format=FORMAT,
                channels=CHANNELS,
                rate=RATE,
                input=True,
                frames_per_buffer=CHUNK)

print("* recording")

frames = []

for i in range(0, int(RATE / CHUNK * RECORD_SECONDS)):
    data = stream.read(CHUNK)
    frames.append(data)

print("* done recording")

stream.stop_stream()
stream.close()
p.terminate()

wf = wave.open(WAVE_OUTPUT_FILENAME, 'wb')
wf.setnchannels(CHANNELS)
wf.setsampwidth(p.get_sample_size(FORMAT))
wf.setframerate(RATE)
wf.writeframes(b''.join(frames))
wf.close()
[\code]
Again, I've never worked with this or audio in general so I'm making some guesses based on the documentation and interwebs.

17
Computer Programming / Re: pocketsphinx
« on: July 07, 2014, 12:55:23 pm »
I've never worked with pocketsphinx, but maybe http://cmusphinx.sourceforge.net/wiki/tutorialam http://cmusphinx.sourceforge.net/wiki/tutorialam or
http://cmusphinx.sourceforge.net/wiki/tutorialam can be of help.  Are you also recording your voice in 16-bit 16kHz single channel mono as stated?

18
Art / Re: General purpose art thread
« on: July 03, 2014, 08:05:15 am »
WIP of an attempt to draw Maka from Soul Eater. What do you guys think? It looks somewhat disproportional to me overall, but the main bother for me is that I messed up the hair :P (badly lit, I know)

19
Gaming Discussion / Re: Steam Summer Sale Confessions
« on: June 20, 2014, 02:00:27 am »
So far I've managed to restrain myself and only bought the Half Life Complete Pack for 9.24 EUR.

20
Gaming Discussion / Re: What game to pick?
« on: June 02, 2014, 03:04:13 pm »
I'm going for Sonic after all. I think I'll be distracted from Monster Hunter really fast because I don't have the time to really get into it. Maybe I'll try the demo sometimes or buy it when it's cheap :P

21
Gaming Discussion / What game to pick?
« on: June 01, 2014, 05:03:35 pm »
So I purchased Mario Kart 8 recently and it comes with a free game. The games I can choose from are:
  • Nintendo Land
  • New Super Mario Bros U
  • Game & Wario
  • Pikmin 3
  • Windwaker HD
  • Sonic: Lost World
  • Mario & Sonic at the Olympic Wintergames (not gonna choose this :P)
  • Wii Party U
  • The Wonderful 101
  • Monster Hunter Tri Ultimate
I already have NL, NSMBU and Pikmin 3. The Windwaker HD looks interesting, but I already have the GC one. My real doubt is between Sonic and Monster Hunter. What would you guys pick?

22
That certainly looks nice. I'm looking forward to the next volume :3

23
Humour and Jokes / Re: Funny #omnimaga quotes (NSFW)
« on: May 22, 2014, 02:52:47 pm »
Spoiler For long:
Samus, boobs and muscles ! :D
Quote
[22:09] <+Streetwalrus> https://wiki.dolphin-emu.org/images/e/e5/Metroid_Other_M.jpg
[22:09] <+Streetwalrus> Wut
[22:09] <+OmnomIRC> (O)<JWinslow23> I just don't need an extra 8 bits of precision.
[22:09] <+Streetwalrus> Samus used to be a muscle mountain
[22:10] <+Streetwalrus> In brawl she's sexy as hell, almost a pr0n*
[22:10] <+Streetwalrus> And now she's just a matches figure O.O
[22:11] <+Streetwalrus> Also where's her iconic blue outfit ?
[22:11] <+OmnomIRC> (O)<JWinslow23> In the game. :p
[22:11] <+OmnomIRC> (O)<Hayleia> wow
[22:11] <+OmnomIRC> (O)<Hayleia> so it made beeps then turned off O.O
[22:11] <+OmnomIRC> (#)* JosJuice has quit #omnimaga (Quit: Leaving.)
[22:12] <+OmnomIRC> (O)<Hayleia> then I turned it back on, it made three beeps between grub and windows
[22:12] <+OmnomIRC> (O)<JWinslow23> http://upload.wikimedia.org/wikipedia/en/thumb/4/4c/Zero_Suit_Samus_Other_M.png/170px-Zero_Suit_Samus_Other_M.png
[22:12] <+Streetwalrus> Yeah I know
[22:12] <+OmnomIRC> (O)<JWinslow23> Zero Suit in Metroid: Other M :p
[22:12] <+OmnomIRC> (O)<Hayleia> but heavy ones, not in the speaker, I am sure my neighbours heard them (not joking nor exxagerating)
[22:13] <+Streetwalrus> Are you serious ? Samus ? This kind of shoes ?
[22:13] <+Streetwalrus> This can't be O.O
[22:13] <+OmnomIRC> (O)<Hayleia> have you seen her stilettos in the upcoming Smash ? :P
[22:14] <+Streetwalrus> What ? O.O
[22:14] * Streetwalrus smacks Nintendo
[22:14] <~Derpy> ponies
[22:14] <+OmnomIRC> (O)<Hayleia> she has "power stilettos" or whatever they called them :P
[22:15] * New post by ordelore in Star Wars Rebels http://ourl.ca/21066/382729
[22:15] <+Streetwalrus> WHERE ARE THE MUSCLES I WANT 'EM BACK
[22:15] * Streetwalrus runs
[22:16] <+Streetwalrus> They call the shoes rocket boots
[22:17] <+Streetwalrus> Now samus is the kind to wear boots
[22:17] <+Streetwalrus> But not that bs
[22:17] <+OmnomIRC> (O)<JWinslow23> I'm not finding any suitless Samus from SSBB.
[22:17] <+OmnomIRC> (O)<JWinslow23> She always has her suit.
[22:17] <+OmnomIRC> (O)<JWinslow23> Street, why lie?
[22:18] <+OmnomIRC> (O)<JWinslow23> jk
[22:19] <+Streetwalrus> Zero suit samus /is/ in ssbb
[22:19] <+OmnomIRC> (O)<Hayleia> (and Project M :P)
[22:19] <+OmnomIRC> (O)<JWinslow23> I just haven't seen it. :/
[22:19] <+OmnomIRC> (O)<JWinslow23> Ah, now I see.
[22:20] <+OmnomIRC> (O)<JWinslow23> I was searching regular Samus. ::)
[22:20] <+Streetwalrus> I'd love her even more if she didn't look so... Rounded if you know what I mean
[22:20] <+OmnomIRC> (O)<Hayleia> no
[22:20] <+Streetwalrus> Big boobs, big butt, no muscles
[22:20] <+Streetwalrus> Want a pic ?
[22:20] <+Streetwalrus> :P
[22:20] <+Streetwalrus> Or rather, a drawing
[22:20] * matrefeytontias hears boobs and butt
[22:21] <+OmnomIRC> (O)<Hayleia> argh, Project M beeps too D:
[22:21] * matrefeytontias runs
[22:21] <+Streetwalrus> Hi matref
[22:21] <~Derpy> <Streetwalrus> Big boobs
[22:21] <+OmnomIRC> (O)<Hayleia> lol matrefeytontias :P
[22:21] <~Derpy> O.O
[22:21] <matrefeytontias> helloes :3
[22:21] <+OmnomIRC> (O)<JWinslow23> No.
[22:21] <+Streetwalrus> Heh derpy
[22:21] <+OmnomIRC> (O)<JWinslow23> Let's change the subject.
[22:21] <+OmnomIRC> (#) EeemsBot has kicked OmnomIRC from #omnimaga (flood)
[22:21] <+Streetwalrus> Talking about samus's evolution over time
[22:21] <+OmnomIRC> (O)<JWinslow23> Let's just talk about 80's Samus.
[22:21] <matrefeytontias> XD
[22:21] * Streetwalrus prods derpy :I
[22:21] <+OmnomIRC> (O)<JWinslow23> JUSTIN BAILEY, anyone? :p
[22:21] <~Derpy> but but but
[22:21] * Derpy boops Streetwalrus
[22:22] <+OmnomIRC> (O)<Hayleia> I misread that "but but but" :P
[22:22] <+OmnomIRC> (O)<Hayleia> and that "boops" :P
[22:22] <+OmnomIRC> (O)<Hayleia> jk
[22:22] * matrefeytontias kills Hayleia
[22:22] <+OmnomIRC> (O)<Hayleia> and where is ElementCoder ?
[22:22] <+OmnomIRC> (O)<Hayleia> matrefeytontias, you were the one to start it :P
[22:22] <+OmnomIRC> (#)* OmnomIRC has joined #omnimaga
[22:22] <matrefeytontias> excuse me ?
[22:22] <+OmnomIRC> (O)<Hayleia> ElementCoder is always there when the convo is about girls usually
[22:22] <matrefeytontias> <Streetwalrus> Big boobs, big butt, no muscles
[22:23] <+OmnomIRC> (O)<Hayleia> I excuse you :P
[22:23] <matrefeytontias> he was the one starting it
[22:23] <+Streetwalrus> LOL
[22:23] <+Streetwalrus> Someone put this convo in the funny quotes thread pls
[22:23] <matrefeytontias> Hayleia I think your mistook Element for Eiyeron :P
[22:23] <matrefeytontias> I can't : laziness
[22:23] <+OmnomIRC> (O)<Hayleia> nope, I really mean ElementCoder
[22:23] * matrefeytontias runs
[22:24] <matrefeytontias> oh well I apparently didn't talk to him enough
I'm a bit surprised I was mentioned here :P

24
TI-Nspire / Re: [Ndless] CoreTemp Remote
« on: May 18, 2014, 04:02:23 pm »
Wow that nspire sure has some epic specs o.o
Nice program though. Could something similar be made for the calculator itself? It wouldn't be very useful I think, but maybe it'd be a nice gimmick.

25
Computer Programming / Re: Two body simulation
« on: May 12, 2014, 02:17:01 pm »
Those were just some test conditions.

I forgot a minus sign in the gravitational force. Everything works fine now :)

26
Computer Programming / [Solved] Two body simulation
« on: May 12, 2014, 09:25:35 am »
I'm trying to make a two body simulation, but it doesn't seem to work :( Plotting x vs y should be circular or elliptical right? Am I choosing the wrong starting conditions or is my way of doing it just wrong?

Code: [Select]
#!/usr/bin/env python
'''
Two body simulation.

'''
from __future__ import division
import math
import matplotlib.pyplot as pyp
import numpy as np

# Gravitational constant (N*m^2*kg^-2)
G = 6.674e-11
# A giga year in seconds.
gyrts = math.pi * 1e7 * 1e9

def Fgrav(M, m, r):
    ''' Gravitational force of two bodies attracting each other.
    '''
    return -G * M * m / r**2
   
# Solar mass (kg)
M = 1.989e30
# Earth mass (kg)
m = 5.9721e24

# Initial conditions.
# Position (m).
x, y = 150e9, 0
X, Y = 0, 0

# Velocity (m/s).
vx, vy = 0, 30e3
Vx, Vy = 0, 0

time = 5*math.pi*1e7
t = 0
dt = 1000
xarr, yarr, rarr, tarr = [], [], [], []
while t < time:
    # Update the positions.
    x += vx * dt
    y += vy * dt
    # Calculate the separation vector.
    dx = x - X
    dy = y - Y
    r2 = dx*dx + dy*dy + 1e-4
    r = np.sqrt(r2)
    #print 'dx, dy: ', dx, dy
    # Calculate components of the gravitational force.
    fgrav_x = Fgrav(M, m, r) * dx / r
    fgrav_y = Fgrav(M, m, r) * dy / r
    #print 'Fgrav: ', fgrav_x, fgrav_y
    # Update the velocities.
    vx += (fgrav_x / m) * dt
    vy += (fgrav_y / m) * dt
    Vx += (fgrav_x / M) * dt
    Vy += (fgrav_y / M) * dt
    #print 'vx, vy: ', vx, vy
   
    X += Vx * dt
    Y += Vy * dt
   
    # Store all data.
    xarr.append(dx); yarr.append(dy); rarr.append(r)
    tarr.append(t)
   
    t += dt
   


fig, (ax1, ax2) = pyp.subplots(2, 'nom')
ax1.plot(xarr, yarr)
ax1.set_xlabel('$x$ (m)'); ax1.set_ylabel('$y$ (m)')
ax2.plot(tarr, rarr)
ax2.set_xlabel('$t$ (s)'); ax2.set_ylabel('$r$ (m)')
fig.tight_layout()

pyp.show()

Edit: Updated with non-broken code.

27
General Calculator Help / Re: ti84+SE keyboard stopped working
« on: April 23, 2014, 12:42:44 pm »
Those sealable plastic bags.


28
ASM / [ARM/Nspire] Drawing sprites
« on: February 01, 2014, 01:29:30 pm »
So I have the following piece of code which draws a sprite on the screen:
Code: [Select]
#include <os.h>
main: .global main
push {r4-r11, lr}
bl lcd_ingray
bl clrscr
ldr r0, =0xC0000010
ldr r0, [r0]
mov r2, #8
adr r1, sprite
add r0, #200 @ x
add r0, #SCREEN_WIDTH/2 * 80 @ y
draw:
ldr r3, [r1], #4
str r3, [r0]
add r0, #SCREEN_WIDTH/2
subs r2, #1
bne draw @ if there are lines left, draw the next one
bl wait_key_pressed
mov r0, #0
pop {r4-r11, pc}

sprite: .word 0x00000000, 0x00000000, 0x00FFFF00, 0x00FFFF00, 0x00FFFF00, 0x00FFFF00, 0x00000000, 0x00000000
This is probably a stupid question, but the problem I'm facing is that I can only use x coordinates that are a multiple of 4. What would I need to do to be able to use any number for the x coordinate?

29
Ndless / Re: ndless 3.2
« on: January 31, 2014, 04:20:14 pm »
The main reason I think is because ndless also opens the way to cheating. Allowing ndless could cause the nspire becoming disallowed on exams and TI would lose a part of their income.

30
Ndless / Re: ndless 3.2
« on: January 31, 2014, 02:25:01 pm »
Nobody knows that. All you can do is wait until it comes or try and help out yourself if you can :)

Pages: 1 [2] 3 4 ... 46